• Resolved caspergrimaldi

    (@caspergrimaldi)


    Hi,
    i have child pages in my top navigation which, if a member is logged in, they do appear on hovering on the parent, however if not logged in, therefore any visitor, they don’t appear at all.

    https://adauk.org

    Navigation tabs meant to have children are “members” and “resources”

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi, maybe your child pages are set to private?

    Dan

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    Nope, they’re not.
    sorry should have mentioned that.

    I created those pages the most simplest way. Add new, put content in the content box and published. No addition of any sort via other plugins, no tags etc

    How are you calling the menu? Can you post the PHP..

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    Here is the header.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    	<head profile="https://gmpg.org/xfn/11">
    		<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ) ?>; charset=<?php bloginfo( 'charset' ); ?>" />
    		<meta name="viewport" content="width=device-width" />
    		<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
    		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    
    		<?php wp_head(); // @see bp_head(); ?>
    
    	</head>
    
    	<body <?php body_class() ?> id="bp-default">
    
    		<?php do_action( 'bp_before_header' ); ?>
    
    		<div id="header">
    			<div id="search-bar" role="search">
    				<div class="padder">
    <div class="logo">
    					<img src="https://adauk.org/wordpress/wp-content/uploads/2013/05/logo.png" alt="ADA" /></div>
    
    				</div><!-- .padder -->
    			</div><!-- #search-bar -->
    
    		<div class="nav-wrap">
    			<div id="navigation" role="navigation">
    
    				<?php if ( bp_is_active( 'messages' ) && is_user_logged_in() ) : ?>
    					<?php frisco_bp_message_get_notices(); /* Site wide notices to all users */ ?>
    				<?php endif; ?>
    
    				<?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>
    
    			</div>
    		</div>
    
    			<?php do_action( 'bp_header' ) ?>
    
    		</div><!-- #header -->
    
    		<?php do_action( 'bp_after_header' ) ?>
    		<?php do_action( 'bp_before_container' ) ?>
    
    		<div id="container">



    [Please use the code buttons when posting code]

    <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary', 'fallback_cb' => 'bp_dtheme_main_nav' ) ); ?>

    This looks very normal to me, but I don’t know what the fallback function is doing. This is usually wp_list_pages() I believe, so your theme must be running some other code. Have you tried removing that, or modifying it? Is the menu definitely set up correctly in the appearance -> menu section?

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    I am not using the appearance/menu section. Just the normal I create a page and it appears in the navigation.

    I am not very good with php. So did not modify this page other than adding the logo picture.
    Not sure what fallback is meant to be.

    What would the normal code be to call the navigation with wp_list_pages? i can try and replace above code with that and see if it makes a difference.

    You can try it without the fallback function and see what you get:

    <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary' ) ); ?>

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    Didn’t work.
    It took the tabs out and listed the pages and the child pages still didn’t show on hover.

    The fact that this doesn’t happen when you’re logged in is very weird. I really can’t think of anything else other than privacy settings. If you make a new menu in appearance -> menus, call it “nav” and add items to it, indent them for the child pages and see if it works. If not, I’m out of ideas at the moment.

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    It does work with the appearance/menu option, however, with that, non members can see restricted to members pages.
    I am using the membership plugin to restrict who can see what.

    The membership plugin is probably your issue then, it may be stopping pages you want to show the public from being viewed. Maybe read up on the plugin a bit and see if it’s set up correctly.

    Thread Starter caspergrimaldi

    (@caspergrimaldi)

    HA, OF COURSE.
    I just presumed that by having authorized the parent page with the plugin would by default authorize the child. Just went to check and no, it didn’t. It’s treating each page individually.
    Problem solved.

    thanks for your help.

    I’m glad to hear it’s fixed. You might want to put the nav code back how it was as well, just in case you need it!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘wordpress child pages don't show on hover for non members’ is closed to new replies.