• adamstruthyahoocom

    (@adamstruthyahoocom)


    Hello,

    I am having a little spot of bother with my navigation.

    I am new to php and wordpress. Is there a way in php to say……

    if a url contains "/members/" show "members-navigation"

    The urls are not static as they will change depending on the name of the post etc, but they all have /members/ as the first part of the url after the domain name.

    Any help would be much appreciated. Thanks in advance for your time.

    Adam.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Samuel B

    (@samboll)

    really need a link

    Thread Starter adamstruthyahoocom

    (@adamstruthyahoocom)

    Thank, I got a friend to work it out….

    <?php
    $uri = $_SERVER["REQUEST_URI"];
    $uri_array = split("/",$uri);
    $uri_first = $uri_array[1]; // might need to change this to [1]
    ?>
    <?php if ($uri_first == 'members'){ ?>
    
    <li><a href="/cgi-bin/select/members.cgi?action=updateyourdata">My Details</a></li>
    <li>etc</li>
    
    <?php } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php – if contains “example” in url?’ is closed to new replies.