Jump to content

Recommended Posts

I have come across a problem whilst integrating wordpress into my website.

 

I have managed to get nav.php to be included in the root of the blog (www.example.co.uk/blog/), but when viewing a post the nav.php does not get included anymore as the directory would not go back as far.

 

This is the current code for it...

include_once('../nav.php');

So it works for www.example.co.uk/blog/, as the nav.php is in the main folder. But when it has something like www.example.co.uk/blog/2010/06/, it doesn't include it.

 

How could I make the path so it is a direct path?

 

I have tried doing the full address (http//www.example.co.uk/nav.php), that doesn't work.

I have tried foing the short address (/nav.php), that doesn't work.

 

If anyone could help me out that would be great.

Link to comment
https://forums.phpfreaks.com/topic/187699-php-includes/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.