• Resolved ashley3ee

    (@ashley3ee)


    How can I change this code to call Pages/Subpages instead of Categories/SubCategories?

    <ul id="nav2" class="clearfloat">
    	<li><a href="<?php echo get_option('home'); ?>/" class="on">Home</a></li>
     	<?php wp_list_categories('orderby=name&exlude=181&title_li=');
     	$this_category = get_category($cat);
     	if (get_category_children($this_category->cat_ID) != "") {
     		echo "<ul>";
    wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);
     		echo "</ul>";
     	}
    	?>
    </ul>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The template tag, wp_page_menu(), or wp_list_pages(), can be used to list Pages.

    Also note the Amazing Grace theme is an example of using both pages and categories in nav bars.

    Thread Starter ashley3ee

    (@ashley3ee)

    Thanks, what I am actually trying to do is instead of making the drop down menu a stacked horizontal list, I’m trying to make the child pages show under it in a horizontal list. Example is the navigation on this site: https://www.prelovac.com/vladimir/

    Here is the code I came up with which kind of works but doesn’t:

    <div id="navbarright">
    		<ul id="nav" class="clearfloat">
    	 	<?php wp_list_pages('title_li=&sort_column=menu_order');
    		$this_post = get_posts($post);
    		if (get_children($post->ID) != "") {
    		echo "<ul>";
    		wp_list_pages('title_li=&child_of='.$post->ID);
     		echo "</ul>"; }
    			?>
    		</ul>
    	</div>

    The problem is 3 things, the list that drops down doesn’t have it’s own class. And 2nd it doesn’t end up linking to the page. And 3rd I don’t want a 3rd tier to drop down?

    Do you know of how I can fix this code? or a theme that integrates it well?

    Thread Starter ashley3ee

    (@ashley3ee)

    oops, I forgot to include the link to my test site to show the navigation problem:

    https://www.veryte.com/reliancechurch/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change wp_list_categories to wp_list_pages’ is closed to new replies.