• Hi all,

    I am having a bit of trouble designing my single.php properly.

    My site consists of three main pages, each with corresponding subpages, seen here.
    The navigation is created in the mutual header, below is the complete code to be precise.

    <!-- Navigation -->
    	<?php switch (is_page(21) || is_page(8) || is_page(295))
    		{ case parentpage: ?>
            <?php if(is_page(21) || is_page(8) || is_page(295)) : ?>
            	<ul class="navigation">
            		<li class="current_page_item">
                    	<a<?php if(is_page('platters'))
    				echo '"href="https://www.pukingalien.com/canapeum/platters/"';
    			elseif (is_page('events'))
    				echo '"href="https://www.pukingalien.com/canapeum/events/"';
    			else
    				echo '"href="https://www.pukingalien.com/canapeum/home/"'; ?>>Home</a>
                    	</li>
                    	<?php
              		global $id;
              		wp_list_pages("title_li=&child_of=$id&show_date=modified&date_format=$date_format"); ?>
    		</ul>
    	<?php endif; ?>
            <?php break;
    	default: ?>
    		<?php if($post->post_parent)
                    	$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
                	else
                    	$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    		if ($children) { ?>
    			<ul class="navigation">
                			<?php if($post->post_parent=="295") {
                    	    		echo '<li><a href="https://www.pukingalien.com/canapeum/platters/">Home</a></li>';
                    		} elseif ($post->post_parent=="21") {
                        			echo '<li><a href="https://www.pukingalien.com/canapeum/events/">Home</a></li>';
                    		} else {
                        			echo '<li><a href="https://www.pukingalien.com/canapeum/home/">Home</a></li>';
                    		} ?>
                    		<?php echo $children; ?>
                		</ul>
            <?php } }?>

    Now my problem is that the navigation doesn’t show on my single.php pages (e.g.)

    What code do I need for the navigation to show even on these pages?

    Thanks,

    em

Viewing 1 replies (of 1 total)
  • I have the same problem. How can you place the single.php in the site structure? I want to place it below a certain page. Is it possible?

Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic navigation on single post pages’ is closed to new replies.