• 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

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

    Thread Starter denovo

    (@denovo)

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

    In my main web site at https://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

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

    Thread Starter denovo

    (@denovo)

    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>

    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?

    Thread Starter denovo

    (@denovo)

    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

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

    Thread Starter denovo

    (@denovo)

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

    Thanks

    Charles

    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.

    Thread Starter denovo

    (@denovo)

    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

    For the top you can try this:
    https://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.

    Thread Starter denovo

    (@denovo)

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

    Best wishes,

    Charles

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