• Hi: We set up WP 3.5 on a development server (windows 2003 r2) using a subdomain (e.g. “blog.mydomain.com”).

    We then duplicated the blog folder to the live server (also server 2003 R2), set up a website for the blog in IIS, and then configured a virtual directory on the live website pointing to the blog website. So now the blog is running as “www.mydomain.com/blog”.

    The only thing that appears to not work on the live site is the category list in the nav menu. Instead of just the top-level categories, all the categories are displaying alphabetical order.

    Even if I run the blog as a subdomain on the live server (e.g. “bloglive.mydomain.com” vs. “www.mydomain.com/blog”), the categories are still not hierarchical, so I don’t believe this has anything to do with running the blog in a virtual directory. If I move the blog back to the development server, the category hierarchy works! (i.e. only the top-level categories appear).

    The code to populate the categories list is simply:

    <?php
    				$args=array(
    				  'orderby' => 'name',
    				  'order' => 'ASC',
    				  'parent' => 0,
    				  );
    				$categories = get_categories($args);
    				foreach($categories as $category)
    				{
    			 ?>
    				<a href="<?php echo get_category_link( $category->term_id )?>" title="View posts in  <?php echo $category->name?>">
    					<?php echo $category->name?>
    				</a>
    			 <?php }?>

    Both servers are running WP 3.5 and PHP 5.4.9. The blog’s mySQL dB is running on a third server, so both the development server and live server are accessing the same database.

    It seems like something else must be different between the two servers, but what would be interfering with the categories call to the dB? I’ve confirmed that the get_categories call in category.php is identical in both servers.

  • The topic ‘Category Hierarchy Broken on one server, working on other IIS’ is closed to new replies.