WordPress.org

Ready to get started?Download WordPress

Forums

Problem referencing categories properly (1 post)

  1. shooter1
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic