Support » Fixing WordPress » How to insert navbar includes

  • Hi

    I want to mimic the look of the wordpress theme I’m using to reflect the general navigational structure of my main web site.

    There seems to be a way to do this within the theme directory path – but this would necessitate changing code in two different locations. Right now the includes for navigation sits in the /www/include in my main web directory.



Viewing 12 replies - 1 through 12 (of 12 total)
  • Say whaa?

    Whoops sorry if this is so confusing – maybe a few links would help.

    In my main web site at there are navigational links at the top/bottom of the web pages. How do I add these to my wordpress section of the site?



    Just call your site nav with a normal php include from the position in the sidebar or header or index files where you want it to show. You may have to tweak with the “normal” sidebar ul and li nested list tags in order to have your nav stuff show properly….

    Hmm…tried it that way already…didn’t seem to want to do it…

    Here’s what I did:

    /* To ease the insertion of a personal header image, I have done it in such a way,
    that you simply drop in an image called 'personalheader.jpg' into your /images/
    directory. Dimensions should be at least 760px x 200px. Anything above that will
    get cropped off of the image. */

    #headerimg { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/personalheader.jpg') no-repeat top;}


    #call navbar

    <?php include('..include/nav.txt'); ?>

    <?php wp_get_archives('type=monthly&format=link'); ?>

    <?php wp_head(); ?>

    <div id="page">

    <div id="header">
    <div id="headerimg">
    <h1>"><?php bloginfo('name'); ?></h1>
    <div class="description"><?php bloginfo('description'); ?></div>

    You mean this one?
    <?php include('..include/nav.txt'); ?>
    1. It is in the wrong place – where do you want it to appear? Put it exactly there!
    2. ..include won’t work. Did you mean: ../include/nav.txt ? IT means you have a folder named “include”, right?

    OK _ I believe I tried it the way you suggested and it didn’t work. But, will try again…

    Also, yes, there is a folder named include off my main web tree path…the includes work for all my other web pages.

    Thanks for your help.


    So, where do you want you navbar to appear on the blog?

    In the main and archive sections. I’ll try what was suggested and report back.



    My question was whether at the top or bottom or…?
    Because even having the right syntax in the call – as you posted it is in the wrong place.

    Ah, I’d like it at the top *and* bottom of the main blog section. As a kind of header, I guess. Not in the sidebar.


    For the top you can try this:
    – or even below the last </div> (I have no idea how your blog looks like)
    Note. I copied the code from above but because you didn’t put it in the “backticks” – see below the text area! – there are some missing parts in it!
    For the bottom: find the proper place in the footer.php or if you don’t have one, in the bottom part of your index.php.

    Thanks so much – that worked! Just have to fix some of the formatting with CSS.

    Best wishes,


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to insert navbar includes’ is closed to new replies.