Hey everyone,
This is my first post here and I've got a good one for anyone who enjoys php.
I want to be able to exclude a link in my menu on my wordpress blog when a specific page is loaded. (The menu isn't managed by the CMS, I manually typed it in to the header.php).
If I were going to write the code in english, it would sound like this.
if page = "THE PAGE IN QUESTION" then "THIS LINK" won't show.
I hope this is clear enough for you all, and I appreciate your help :thumbup1:
Need to exclude a link when a certain page is displayed.
Started by VilPietersen, Jul 01 2010 08:51 AM
2 replies to this topic
#1
Posted 01 July 2010 - 08:51 AM
|
|
|
#2
Posted 01 July 2010 - 04:47 PM
if ($page != "pagename") {
echo '<a href="page">link</a>';
}
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#3
Posted 03 July 2010 - 09:30 PM
You could also use server variables to get the page name:
<?PHP
if($_SERVER['REQUEST_URI'] != "/page.html") {
echo '<a href="page">link</a>';
}


Sign In
Create Account

Back to top










