How To Add Pages

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='); ?>
&lt;li id="t-search"&gt;&lt;div class="hide"&gt;&lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;&lt;/div&gt;&lt;/li&gt;

To see more information on using pages visit the WorPress Codex here

About Marco

I'm a WordPress Enthusiast and share what I learn about theme's plugins, code and reviews of everything WordPress

20 Comments

  • DM
    February 3, 2009 | Permalink |

    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

  • February 4, 2009 | Permalink |

    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.

  • michelle
    February 7, 2009 | Permalink |

    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.

  • michelle
    February 7, 2009 | Permalink |

    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 ‘=’ ?

  • February 7, 2009 | Permalink |

    Hi Michelle,

    Do you have a link?

  • Michelle
    February 8, 2009 | Permalink |

    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!

  • February 8, 2009 | Permalink |

    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?

  • February 10, 2009 | Permalink |

    I had the same results as Michelle. The code breaks when inserted as outlined above. Any ideas?

  • February 10, 2009 | Permalink |

    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.

  • February 10, 2009 | Permalink |

    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?

  • February 10, 2009 | Permalink |

    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:

    <li class=”current-catcat-item”><a href=”">

    To this:

    <li class=”current-catcat-item”><a href=”">

  • February 10, 2009 | Permalink |

    Sorry, try this

    In the header.php add:

    So you change this:

    <li class=”current-catcat-item”><a href=”">

    To this:

    <li class=”current-catcat-item”><a href=”">

  • February 10, 2009 | Permalink |

    I can’t get the blockquotes to work and display code.

  • February 10, 2009 | Permalink |

    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&amp;fg=ffffff&amp;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&amp;fg=ffffff&amp;anim=0" height="26" width="88" style="border:0" alt="" /></a></li>
    </ul>

  • February 12, 2009 | Permalink |

    Thanks mscott!

    Very useful information.

    How’s the site going? I see you dropped the Carousel. : (

  • February 13, 2009 | Permalink |

    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.

  • February 15, 2009 | Permalink |

    Is there any way to have pages AND categories listed in the top menu?

  • February 15, 2009 | Permalink |

    Nevermind… did the above as instructed and it worked!

  • February 15, 2009 | Permalink |

    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.

Leave a comment

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Your email is never shared. Required fields are marked *

You Might Also Like

Plugins »

WP125 Ad Management Plugin

Fri, Feb 27 2009 No Comments
WP125 Ad Management Plugin

With over 13,000 thousand downloads this plugin is hardly a secret but better than a secret is the fact that it works right out of the box. Its great for... 

Tools and Links »

Forums For Your Website

Fri, Feb 20 2009 No Comments
Forums For Your Website

I wanted to add a forum to this site so I decided to browse what was available and suitable for my needs. First I’m looking for something that’s...