Two more categories to one at post-categories

Hello!

If a post added to two or more categories,i see all the categories to <ul class=”post-categories”>.How can i edit <ul class=”post-categories”> to show only one category from all?

Hi @tsakman,

I hope you are well today and thank you for your question.

It seems you are talking about the categories displayed in the slider.

You can try achieving this by adding the following CSS code in the Custom CSS option of your theme on the below path.

Admin Area -> Appearance -> Customize -> Activello Options -> Other -> Custom CSS


.flexslider .flex-caption .post-categories li{
display: none;
}
.flexslider .slides .flex-caption .post-categories li:first-child{
  display: block;
}

Best Regards,
Movin

Thank you for your answer,and sorry for i was not be so cleared.I meαnt the post categories below slider.For example i make a food blog.One post i added to 2 or 3 categories.Is it possible to hide one or two category tag from post-categories cat tile and show only the one i prefer?
Thank you for all

Please try using the below CSS code to achieve this.

body.single-post .post-categories li{
display: none;
}
body.single-post .post-categories li:first-child{
  display: block;
}

Really thank you for this.U are the best.It does the job.But is it possible with this code to remove custom post-categories li?If a post linked to 3 categories to remove from title the cat-titles i prefer?
Thank you very much

You are most welcome here :slight_smile:

But is it possible with this code to remove custom post-categories li?If a post linked to 3 categories to remove from title the cat-titles i prefer?

I am not sure i understood your question so could you please describe it a bit more in detail?

Sorry for my late respond.
The problem is if i have a topic connected to two or more categories,all categories-tags shows at single post.

For example i have a Z post connected to A,B and C categories.In my single post i see both A B C together at category title

How can i have this post connected to all three categories but in category-tag show only one of these three,the category-tag i manually choose to show as category-tag.Or A or B or C

The

body.single-post .post-categories li{
display: none;
}
body.single-post .post-categories li:first-child{
  display: block;
}

does the job but i cant choose the category-tag i want.

Thank u

does the job but i cant choose the category-tag i want.

You have to create child theme of Activello theme and develop custom code in it to achieve this.

Developing custom code for custom functionality is beyond the scope of support that we provide here.

If you are not a developer then you can consider hiring a developer to develop it for you. You can hire a developer from any freelance site. Colorlib recommends the developer https://www.upwork.com/freelancers/~011652ffec8865c6d5

Thank you for your help.I just do it with the code below:(I placed it at functions.php)

add_filter('get_the_terms', 'hide_categories_terms', 10, 3);
function hide_categories_terms($terms, $post_id, $taxonomy){

    // list of category slug to exclude, 
    $exclude = array('your-term-slug', 'another-term-to-hide');

    if (!is_admin()) {
        foreach($terms as $key => $term){
            if($term->taxonomy == "category"){
                if(in_array($term->slug, $exclude)) unset($terms[$key]);
            }
        }
    }

    return $terms;
}

You are always welcome here :slight_smile: