I want to add a variable in the Menu, for passing a value in all my page. The purpose is to retrieve a value for transport to another web site (from my website links) to the tracking, this value depends on the origin of the user.
eg of my menu :
- Home = mylink/?partenaire=<?php
echo $myPartenaire;
?>
- About us = mylink/aboutus.php?partenaire=<?php
echo $myPartenaire;
?>
- Contact = mylink/contact.php?partenaire=<?php
echo $myPartenaire;
?>
I can retrieve the value in my page but not in the menu
I've installed this plugin to put PHP in my page http://wordpress.org/extend/plugins/insert-php/
In function.php before "
?>" at the bottom of the page, I've add :$myPartenaire = $_GET['partenaire'];In header.php At the beginning, I've add :
<?php global $myPartenaire ; ?>In my page I can retrieve the value, I've add :
[insert_php] global $myPartenaire ; [/insert_php] <a href="http://mylink.com/mypage.php?partenaire=[insert_php] echo $myPartenaire; [/insert_php]">LINK OF MY PAGE</a> eg : mylink/contact?partenaire=<?php echo $myPartenaire; ?>
I know after how to get the value of "partenaire" in my page, but I don't know how to add the value
partenaire=<?php
echo $myPartenaire;
?>
in all the link in my nav menu.