Support » Networking WordPress » Multisite category conditional string in index.php not working

  • I have a non-multisite where I exclude a certain category from home/frontpage (first line of code below) and sort posts in a certain category page (when only that category is selected/displayed) by descending date (the second line of code below) in the index.php and it all works just fine on a wordpress single site install.

    if (is_home()) {query_posts('cat=-2'); }
    if (is_category( '4' )) {query_posts('cat=4&orderby=date&order=DESC'); }

    I also have a subdomain multisite where I want to do the exact same thing. The exclusion of a category works just fine and I do want to exclude that category from all sites on the multisite; which works just fine. However I can’t sort posts in a certain category page by descending date. The second line of code above has no effect on the site whatsoever. (I do understand that the multisite is not using an individual prefix for each sites categories, which could be solved by using blog_id and category as a conditional.)

    I assume I have to change the second line of code to select the category on a certain blog_id or if I possibly can get it to work with if is_site_url or relative path to root (however subdomain multisite) instead of is_category.

    I appreciate any help on how I can make the second line of code to work. I understand that this can be solved in another way, but I am no coding expert and want to keep it simple by using only a few lines of code in the index.php

    • This topic was modified 4 months, 1 week ago by  Steve Stern.
    • This topic was modified 4 months, 1 week ago by  Omega Man.
    • This topic was modified 4 months, 1 week ago by  Omega Man.
    • This topic was modified 4 months, 1 week ago by  Omega Man.
    • This topic was modified 4 months, 1 week ago by  Omega Man.
  • You must be logged in to reply to this topic.