• Resolved dmx09

    (@dmx09)


    Hi all,
    I’ve been trying to figure out how to show my custom menus (2 at the minute) only on the pages that I want them displayed.

    I’m using ‘widget logic’ and ‘display widgets’ plugins to do most of the work but while they allow me to show & hide the menus on pages and categories, they don’t seem to work for single post pages (ie: pages using single.php).

    Does anyone know if I can use code to display each custom menu (ie; in single.php), at the moment they are added as custom menu widgets.

    Unfortunately, I can’t post a url here but if anyone has any ideas… ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dmx09

    (@dmx09)

    I’ve gotten a little further but could use some help if possible..
    I wondered if its possible to adapt this code to include an if statement.

    So if its single and in category x, load Events menu, otherwise load News menu..

    <?php
    	if ( is_single() ) : ?>
    	<div class="widget">
                <h3>What's On</h3>
    	    <?php wp_nav_menu( array('menu' => 'Events Menu' )); ?>
            </div>
    	<?php endif ; ?>
    Thread Starter dmx09

    (@dmx09)

    Sorted the problem , if anyone is interested..

    <?php
       if ( is_single() || is_archive() || is_page(4) || in_category( array('news', 'events', 'partner-events'))) : ?>
    	<div class="widget">
                <h3>What's On</h3>
    	    <?php wp_nav_menu( array('menu' => 'Events Menu' )); ?>
            </div>
    <?php endif ; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display category menus on single post pages’ is closed to new replies.