|
|
#1 |
|
Silver Member
![]() Join Date: Aug 2011
Posts: 187
|
I have a main nav horizontal with the
HTML Code:
wp_list_pages('depth=1&title_li=<h2 class="displaynone">Pages</h2>);
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 HTML Code:
<?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 }?> Last edited by benjamin.morgan; 12-18-2011 at 01:46 PM. Reason: Change title to add wordpress |
|
|
|
|
|
#2 |
|
Silver Member
![]() Join Date: Aug 2011
Posts: 187
|
Okay I solved that. I will just go with posts as pages. Now on the index page which is the About Us page i want to be able to display a header.
<?php if(trim(wp_title('', false))=="") { echo "<h1>About Us</h1>"; } ?> Now that isn't working. |
|
|
|
|
|
#3 |
|
Silver Member
![]() Join Date: Aug 2011
Posts: 187
|
HTML Code:
<?php if(trim(wp_title(""))!="") { trim(wp_title("")); ?> <?php echo " - ";?> <?php bloginfo('name'); } else { bloginfo('name'); } ?> Now that isn't working. |
|
|
|
|
|
#4 | |
|
New Member
![]() Join Date: Dec 2011
Posts: 18
|
Quote:
Use the exclude pages plugin. It's a great plugin that will allow you to choose which pages no to show in the main navigation. I use it all the time. Then do as you did with the if statement to show your sidebar. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|