• Hello,
    I need help please.
    I have menu links such as this one which I need to implement in my wordpress menu and don’t know how to :

    <a href="void(0)">';document.forms['rencMenu'].submit();"><li <?php if (strstr($_SESSION['rencontre'],'portrait') && $_GET["id"]==$mid) echo 'class="current"'; ?>>

    Thank you for your help !
    Lucile

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

Viewing 1 replies (of 1 total)
  • Thread Starter lucilem

    (@lucilem)

    Oops the code didn’t come out properly.

    Here is the kind of menu links I need to implement in my wordpress menu :

    <a href="javascript:void(0)" onClick="document.forms['rencMenu'].elements['page'].value='portrait';document.forms['rencMenu'].elements['id'].value='<?php echo $mid; ?>';document.forms['rencMenu'].submit();"><li <?php if (strstr($_SESSION['rencontre'],'portrait') && $_GET["id"]==$mid) echo 'class="current"'; ?>>Title</li></a>

    I figured out that using # in wordpress menu via the admin works for the javascript part entering the function in the functions.php file but how do I do for the “if session” part ?

    Thank you,

    Lucile

Viewing 1 replies (of 1 total)

The topic ‘Custom link menu including javascript AND if session’ is closed to new replies.