Support » Themes and Templates » Integrating second menu into single pages

  • Resolved FuxiAdmin



    I would like to integrate a vertical menu to sit at the left side of my posts, please view,

    In this menu I will include further subcategories to the available subcategories in the top horizontal menu. I have already created the menu in CSS, please view,

    This vertical menu is relative to the category that the post has been written for only.

    My current main menu is a widget, loaded through the header.php

    I have included this vertical menu in my single.php;

    <?php get_header(); ?>
    <div id="bigcolumn">
    $post = $wp_query->post;
    if ( in_category('45') ) {
    include (TEMPLATEPATH . '/widgets/single2.html');
    } elseif ( in_category('8') ) {
    include (TEMPLATEPATH . '/widgets/single.html');
    } else { ?>
        <div id="singleleftcolumn"><?php $sec = 1; include TEMPLATEPATH. '/widgets/news_left.html'; ?></div>
        <div id="singlerightcolumn"><?php $sec = 2; include TEMPLATEPATH. '/widgets/single3.html'; ?></div>
    <div class="clear"></div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Does anybody know how I can integrate this new menu so that it is specific to the category that the post is in, e.g Film, Music… etc.

    Code for my horizontal menu is as follows,

    <div id="menu">
    	<?php if ($comfy['menu'] == true) : ?>
    	<li<?php if(!is_category() && !is_page()) { ?> class="current-cat"<?php } ?>><a href="<?php bloginfo('home'); ?>/" title="Home"><?php print NAV_HOME; ?></a></li>
    	<?php wp_list_categories('orderby=ID&order=ASC&depth=2&hide_empty=0&title_li=&exclude='.$comfy['featured']); ?>
    	<?php endif; ?>
    	<?php if ($comfy['search'] == true) : ?>
    	<form class="searchform" method="get" action="<?php bloginfo('url'); ?>/">
    			<input type="text" value="<?php the_search_query(); ?>" name="s" class="searchfield" />
    			<input type="submit" value="" class="searchbutton" />
    	<?php endif; ?>

    Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Think I should re-word some of this. Does anybody know what I should change in the above menu php to target the ‘child’ and ‘grandchild’ categories, of a particular parent category?

    I’m starting to get somewhere, have managed to get a menu running down the left side, using the following code,

    <div id="fuximenu">
    	<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>";
     		echo "</ul>";

    Does anybody know what to change in the code so that it targets and only shows the child categories of a specific parent category?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Integrating second menu into single pages’ is closed to new replies.