• I want to tell wordpress that when I am on the page “como-comprar-bienvenida” the category item “De Bienvenida”(slug=bienvenida) must be marked as current-cat.

    this is my code:

    <ul>
    <?php
    if  (!is_home()){
    	$catsy = get_the_category();
    	$myCat = $catsy[0]->cat_ID;
    	$currentcategory = '&current_category='.$myCat;
    	}
    // this is what I can′′ get to work
    elseif (is_page("como-comprar-bienvenida")) {
            $currentcategory = '&current_category=bienvenida';
     }
    wp_list_categories('orderby=id&include=1,3&hide_empty=0&style=list&title_li='.$currentcategory);?>
    </ul>
    <ul>
    <?php wp_list_categories('orderby=id&include=4,5&hide_empty=0&style=list&title_li='.$currentcategory); ?>
    </ul>

    This is teh URL for the “como-comprar-bienvenida” page where “De Bienvenida” must be marked:
    https://k-i-t.com.ar/como-comprar-bienvenida

    I can′t make it work, any ideas?
    Thank you!!!

  • The topic ‘Mark a category list item as current-cat when I′m on a page’ is closed to new replies.