Jump to content

Recommended Posts

Posted

I have a main nav horizontal with the wp_list_pages('depth=1&title_li=<h2 class="displaynone">Pages</h2>);

On the commercial page (on main navigation) I need to have a vertical sidebar only on this page. I don't know how to make it where he can add pages to it like that. So far when it creates a page it adds it to the main nav bar.

Posted

I tried doing an If statement. It didn't work. For some reason the only thing it is putting on the sidebar is the word Commercial

<?php
if(trim(wp_title(''))=="Commercial") {
?>
<ul class="comside">
<?php
$recent_posts = wp_get_recent_posts();
foreach($recent_posts as $recent){
	echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .  $recent["post_title"].'</a></li> ';
}
?>
</ul>
<?php }?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...