• I’d like to add a few navigation links/pages such as about, contact us, work etc. I created a .php file called navigation.php, i tried using <?php get_navigation(); ?> in html but it didnt work. I was wondering if I could use static pages within my blog folder or if it has to be outside of that. I will be using a lot of static pages so i dont know how WP handles them. Any suggestion is helpful.

Viewing 10 replies - 1 through 10 (of 10 total)
  • try <?php include "navigation.php"; ?>
    that would get the file from with the current theme directory.

    For the code you posted it has to be a function written to work.
    Just use simple include.
    I have also included a horizontal menu in my theme, called it horizontal.php and the code to call it was:
    <?php include (TEMPLATEPATH . '/horizontal.php'); ?>
    Change the filename and leave the rest – providing the file is in the theme directory!

    <?php include('path/to/navigation.php'); ?>
    That should work.

    You can put static pages anywhere so long as each page that will use any WP functions has a call to wp-blog-header at the top.

    <?php
    require('./wp-blog-header.php');
    ?>

    Get the path to that file correct though.

    Thread Starter jmdesigner81

    (@jmdesigner81)

    Oh I see! I will try that! Thanks a lot!

    Thread Starter jmdesigner81

    (@jmdesigner81)

    Hey guys! I’m still getting in error “Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/pibstoughton.com/httpdocs/wp-content/themes/Jmdesign01/index.php on line 3”. I placed the navigation.php inside theme/jmdesign01(my theme) it giving me error. Any suggestions?

    Thread Starter jmdesigner81

    (@jmdesigner81)

    Check out the error messagePib Stoughton

    What did you use to call the navigation.php file?

    Thread Starter jmdesigner81

    (@jmdesigner81)

    That’s what i’m using <?php include(‘navigation.php’); ?>

    Make sure the “path” is set in your file reference. See above for specifics. Like /wp-content/themes/navigation.php.

    So you put this line of code in one or more of your template files (index, page, archive etc.) that are in the same theme-directory as the navigation file, right?
    Can you give it a try with the code I’ve showed above?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘adding a navigation’ is closed to new replies.