Support » Fixing WordPress » Problem referencing categories properly

  • Hi all

    I adapted the following code from a website for displaying paged navigation with sub pages, and keeping the parent page link highlghted while the user was on the children page.

    I have tried to adapt it to work for categories but am getting a ‘no categories’ message so I think there is something wrong with my referencing.

    $thiscat = $wp_query->post;
          if($thiscat->category_parent!=0)
    
       {
    
    wswwpx_fold_category_list("title_li=&child_of=".$thiscat->post_parent);
    
          }
    else
    {
     wswwpx_fold_category_list("title_li=&child_of=".$thiscat->cat_ID);
    }

    The thing is if I change the cat_ID to ID it will display the correct sub categories but on a different page section of the website which shares the same ID number. I just need to know how to reference the category ID uniquely.

  • The topic ‘Problem referencing categories properly’ is closed to new replies.