Sidebar content based on url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hpersson
Forum Newbie
Posts: 1
Joined: Wed Apr 22, 2009 3:05 pm

Sidebar content based on url

Post by hpersson »

Hi, new here so I hope you guys will help me out with this.

I have been tearing out my hair over this problem.

I have a wordpress site that i combine with another script.

The root of the domain is my wordpress blog.
The script i got in different folders ie /uk/,/en/,/se/ and so on.

The script is including the wordpress header,sidebar and footer to make it become a part of the wordpress site, so far so good.

But the my problem is that each folder has a different menu that i would like to include in the wordpress sidebar.

So what i would like to do is something like this

if url = mysite.com/uk
then $sidebar = uk_sidebar

elseif url =mysite.com/se
then $sidebar = se_sidebar

else
then $sidebar = wordpress_sidebar

But i am unable to check the url from the sidebar.

Any ideas on how I can accomplish this?
I would really appreciate all ideas.

Howard
Reviresco
Forum Contributor
Posts: 172
Joined: Tue Feb 19, 2008 4:18 pm
Location: Milwaukee

Re: Sidebar content based on url

Post by Reviresco »

Code: Select all

 
$url = $_SERVER['PHP_SELF'];
 
Info:
http://us3.php.net/manual/en/reserved.v ... server.php
Post Reply