Premium Wordpress themes are like TheStars give developers and WordPress users a great option for a good looking site.
Adding Pages to the top of the Menu:
First: open up the header.php from your theme editor.
Second: Look for this line of code:
<div id="top"> <div class="pads clearfix"> <ul>
Third: Then Add this line of code:
<?php wp_list_pages('title_li='); ?>
So the complete code should look like this:
<div id="top">
<div class="pads clearfix">
<ul>
<?php wp_list_pages('title_li='); ?>
<li id="t-search"><div class="hide"><?php include (TEMPLATEPATH . '/searchform.php'); ?></div></li>
To see more information on using pages visit the WorPress Codex here






































20 Comments
Hello,
I followed you here from The Stars theme demo. Thanks for the above information. I wanted to know that, too. Hey I was wondering if you could help me with a couple of problems?
1: How to add a set of 2 – 125 x 125 ad blocks (side by side) to the sidebar.php
I need them to line up correctly and look good.
2: How to add an image to the home.php between the flickr feed and the “Latest News” section. I put one there and it looks fine in Opera, but IE7 is showing words on top of words in the post section under latest news.
I figure there is some php or html code that would allow some break or something that would fix the problem. Some thing that would push that section down??? Visit my site to see what I mean. Please realize that this site is a work in progress and have used some pics from the demo for testing purposes.
Thank you!
DM
Hey DM,
Okay lets take this one by one.
Adding a set of ad blocks like the ones I have here requires some CSS knowledge and then adding it to your sidebar template. Let me see if I can get some code up for you in a bit.
-
The image you have beneath featured stories looks to be to big, try rezizing it to 578 width. I don’t have IE7 but I know there are many problems the way it handles code.
Try using the code below:
Open the home.php template and right under the
Add this
Let me know if this at least helps.
Here is the code to add a banner under the featured section
i added the code to add pages and it broke the blog. had to yank it. copied and pasted right where you told me to. what might be conflicting with that code or is it standard coding? thanks for any insight you may have.
here’s what it does: Parse error: syntax error, unexpected ‘=’ in /home/content/m/l/c/mlc4176/html/wp-content/themes/thestars/header.php on line 49
when i remove the = then the pages show up, but all out of whack at the top of the page rather than horizontally. is there supposed to be a value after the ‘=’ ?
Hi Michelle,
Do you have a link?
Hi Marco, with some added research I found this: since I have subpages and that may have affected things. I’ll figure out subpages later; for now all pages inc. subs are in a flat line across the top and that’s fine…thanks!
No problem Michelle, There might be a few ways to add drop down pages to the top menu I’ll look into it.
P.S. Do you have a link to your website?
I had the same results as Michelle. The code breaks when inserted as outlined above. Any ideas?
I solved my problem. I just needed to study the Codex a bit more and all is good.
I like your modifications to “The Stars” theme.
Thanks mscott! I like what you have done with the theme too! Especially the Carousel effect, is that a WP Plugin or did you hardcode it?
The carousel is hardcoded jCarousel.
I was able to take your information about pages a step further. I have integrated categories and pages on the theme’s nav bar. This solves Michelle’s problem since the CSS in the theme handles subpages. It shouldn’t be too difficult to organize items on the nav bar.
In the header.php add:
So you change this:
Sorry, try this
In the header.php add:
So you change this:
To this:
I can’t get the blockquotes to work and display code.
One more time.
In the header.php add:
<?php wp_list_pages('title_li='); ?>
So you change this:
<ul id="nav" class="clearfix">
<li class="<?php if (((is_home()) && !(is_paged())) or (is_archive() && !(is_category())) or (is_single()) or (is_paged()) or (is_search())) { ?>current-cat<?php } else { ?>cat-item<?php } ?>"><a href="<?php echo get_settings('home'); ?>"><?php _e( 'Home', 'wpbx' ) ?></a></li>
<!– change "depth=3" to suit your menu depth level, and change "exclude=x" with the category ID that you want exclude from the menu (multiple categories separated by , (comma) –>
<?php wp_list_categories('orderby=ID&order=ASC&depth=3&title_li=&exclude='); ?>
<li id="m-subscribe"><a href="http://feeds.feedburner.com/YOURFEEDBURNERUSERNAME"><img src="http://feeds.feedburner.com/~fc/YOURFEEDBURNERUSERNAME?bg=e33258&fg=ffffff&anim=0" height="26" width="88" style="border:0" alt="" /></a></li>
</ul>
To this:
<ul id="nav" class="clearfix">
<li class="<?php if (((is_home()) && !(is_paged())) or (is_archive() && !(is_category())) or (is_single()) or (is_paged()) or (is_search())) { ?>current-cat<?php } else { ?>cat-item<?php } ?>"><a href="<?php echo get_settings('home'); ?>"><?php _e( 'Home', 'wpbx' ) ?></a></li>
<!– change "depth=3" to suit your menu depth level, and change "exclude=x" with the category ID that you want exclude from the menu (multiple categories separated by , (comma) –>
<?php wp_list_categories('orderby=ID&order=ASC&depth=3&title_li=&exclude='); ?>
<?php wp_list_pages('title_li='); ?>
<li id="m-subscribe"><a href="http://feeds.feedburner.com/YOURFEEDBURNERUSERNAME"><img src="http://feeds.feedburner.com/~fc/YOURFEEDBURNERUSERNAME?bg=e33258&fg=ffffff&anim=0" height="26" width="88" style="border:0" alt="" /></a></li>
</ul>
Thanks mscott!
Very useful information.
How’s the site going? I see you dropped the Carousel. : (
The carousel is still in. I’m just testing the theme for work on my personal site. The theme is on a dev server at work and because of the limited write permissions I couldn’t mess around with some of the plugins.
My actual site will be more of a portfolio site.
Is there any way to have pages AND categories listed in the top menu?
Nevermind… did the above as instructed and it worked!
Hey Bessie,
You can see how to add pages to the main menu here Also details how to exclude certain pages and categories so not to overload the main menu.