Support » Installing WordPress » Problem with category/sidebar after upgrade to wp2.6

  • Resolved morganfardo

    (@morganfardo)


    Hi!

    i upgrade to WP2.6.. after that i had a lot of problems with categories… some of them i could solve using wp-database… but the situation is, i have the following category structure:

    Books
    – Economics (first level)
    — game theory (second level)
    — Principles of Economics (second level)

    I have 5 child category(2nd level) inside book category… i set it to open a sidebar_book to all the child categories inside book using a (is_category()) function…

    after upgrade to wp2.6 only one of the child category (2) do not call the right sidebar, it calls sidebar.php

    I already tried to set a if (is_category()) using the child category ID but it didn’t work…the problem is with “Principles of Economics”

    PLEASE HELP!

    thanks in advance.

    morgan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter morganfardo

    (@morganfardo)

    forgot to say… when i write a new post, in category field it shows correctly with principles of economics and all the other child categories inside books. But when editing a post it shows all the child categories of books as if they were a parent category.

    Hi people! I finally solve this problem.
    The get_the_category() function returns the categories ordered by category name. I used the following code:

    <?php
    	$category = get_the_category();
    	foreach($category as $cat) {
    		if($cat->category_parent == 0) {
    			if($cat->cat_ID == 28) { // Books category ID
    				include(TEMPLATEPATH . '/sidebar_livros.php');
    			} else {
    				get_sidebar();
    			}
    		}
    	}
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with category/sidebar after upgrade to wp2.6’ is closed to new replies.