• I have installed the new WordPress Version (1.5) and it is all ok, apart from an important detail: I cannot re-organize my categories in the original hierarchy. Also if in the admin side they are organized by mother-children, in the web site the appear to be the same, with no differences between mother and children ones.
    I have already tried with this piece of code:

      <?php wp_list_cats(“sort_column=name&list=0&hierarchical=1”); ?>

    but it does not work anyway…
    Is it a bug? Is there a way to set the hierarchy as it was in the old version?
    Thanks for your help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi, I am still learning WordPress, so please pardon me if I am misunderstanding because of inexperience.

    I think it is the list=0 part that’s making the parents and children look alike. Elminating list=0 will allow WordPress to use list formatting, which is default. This is what was needed on my setup to get what I think you may want:

    • <?php wp_list-cats(‘sort_column=name& hide_empty=0’); ?>
    • I left out children=1&hierarchical=1&list=1 because they are default but you could add them in if needed for some reason.

      Reference: codex: wp_list_cats().

    Thread Starter BlueValentine

    (@bluevalentine)

    Thank you so much!
    This code really works!

    <?php wp_list_cats(‘sort_column=name& hide_empty=0’); ?>

    It worked for me too. Very awesome.

    I want to know though. When you click on a category link, how can you make it so that it displays all posts under that category, instead of just the option you selected of how many days or posts?

    Thread Starter BlueValentine

    (@bluevalentine)

    I do not have this kind of problem, I can’t figure out what it can depend on…
    Sorry…

    publius, I don’t know, but I have something you may want to check out.

    I just looked at the source and found this, which appears that one can alter the limit with the query string.
    $limits = "LIMIT ".$pgstrt.$q["posts_per_page"];
    Looks promising, and it appears to do something.
    Compare
    https://www.publiuspundit.com/index.php?cat=1
    to
    https://www.publiuspundit.com/index.php?cat=1&posts_per_page=100

    However, I have reason to think it doesn’t exactly do what you want. Certainly try it out if you like, though.

    That looks pretty close. The result I need is not a specified number of posts, though, but just for it to show all of them.

    Wow – that code worked perfectly for me too…I had that problem too, but it was secondary to some others, so hadn’t posted about it. Thanks~!! ^^

    set posts_per_page equal to -1

    Well what I want to do is have the front page show the last three days, with the categories and archives showing all. How can I do that?

    I don’t know exactly how to do what you want off the top of my head, and it is too time intensive for me try and test. However, here’s what I’d try, maybe you can try it.

    To accomplish what you want, there are two changes that need to occur, both in the index.php file of your theme.

    First, you need to limit the index page to three days. I’ve asked about showing odd timespans of posts and I’ve looked in the source. I don’t think it’s possible without hacking though I’d love to be corrected. You can, however, show the last week, or show today, yesterday, and the day before in three steps. Try out tossing various query strings (the part after the question mark in your urls) into query_posts(‘query_string_here’) before “the loop”.

    Second, you need to change the category links so that they contain the posts_per_page code mentioned above in the query string. Neither list_cats nor wp_list_cats allows this directly, perhaps a filter would do the job. Or, you can forgo changing the category links, and instead change the query string in the category.php theme page.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Hierachy of categories’ is closed to new replies.