WordPress.org

Ready to get started?Download WordPress

Forums

How to insert navbar includes (13 posts)

  1. denovo
    Member
    Posted 9 years ago #

    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.

    Thanks

    Charles

  2. Ryan Duff
    Member
    Posted 9 years ago #

    Say whaa?

  3. denovo
    Member
    Posted 9 years ago #

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

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

    Thanks

    Charles

  4. vkaryl
    Member
    Posted 9 years ago #

    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....

  5. denovo
    Member
    Posted 9 years ago #

    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;}
    */

    </style>

    #call navbar

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

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

    <?php wp_head(); ?>
    </head>
    <body>

    <div id="page">

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

  6. moshu
    Member
    Posted 9 years ago #

    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?

  7. denovo
    Member
    Posted 9 years ago #

    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.

    Charles

  8. moshu
    Member
    Posted 9 years ago #

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

  9. denovo
    Member
    Posted 9 years ago #

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

    Thanks

    Charles

  10. moshu
    Member
    Posted 9 years ago #

    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.

  11. denovo
    Member
    Posted 9 years ago #

    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.

    Thanks

  12. moshu
    Member
    Posted 9 years ago #

    For the top you can try this:
    http://pastebin.com/310086
    - 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.

  13. denovo
    Member
    Posted 9 years ago #

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

    Best wishes,

    Charles

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags