• I want logged in members to not see the ‘register’ page (on menu)

    How can I hide certain pages from certain users?

Viewing 5 replies - 16 through 20 (of 20 total)
  • No probs, try:

    <?php
    if (get_option('woo_nav') == 'true' )
    	wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude=');
    else{
    	$mypages = wp_list_pages('echo=0&sort_column=menu_order&depth=3&title_li=&exclude=');
    	if(is_user_logged_in()){
    		$reglink = '<li class="page_item page-item-79"><a href="https://wowgoldadvisor.com/?page_id=79" title="Register">Register</a>';
    		$loginlink = '<li class="page_item page-item-24"><a href="https://wowgoldadvisor.com/?page_id=24" title="Login">Login</a></li>';
    		$mypages = str_replace($reglink,'',$mypages);
    		$mypages = str_replace($loginlink,'',$mypages);
    	}
    	echo $mypages;
    }
    ?>

    Would you also want the “Profile” link to only show if people are logged in?

    Thread Starter cellydy

    (@cellydy)

    fantastic!

    And finally! (:P)

    If I want to hide ‘Profile’ Link from NON logged on people? (so it just displays Login + Register)

    Could you please help out this last time?

    Thanks soooooo much for your help ??

    Try this it’s a simpler option:

    <?php
    if (get_option('woo_nav') == 'true' )
    	wp_list_categories('sort_column=menu_order&depth=3&title_li=&exclude=');
    else{
    	if(is_user_logged_in()){
    		wp_list_pages('sort_column=menu_order&depth=3&title_li=&exclude=79,24');
    	}
    	else{
    		wp_list_pages('sort_column=menu_order&depth=3&title_li=&exclude=85');
    	}
    }
    ?>
    Thread Starter cellydy

    (@cellydy)

    Thanks for all your Help!

    Cheers

    Thank you for this, this is exactly what I needed, thank you so much! Much appreciation!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Hide ‘register’ menu when logged in!’ is closed to new replies.