Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter qmic76

    (@qmic76)

    Hey Jleuze,

    Thanks for the help it worked on the responsive, now I want to put it on the twenty eleven theme and the header php looks a little different (see below). I would like to be in the place of the static header images on the theme with the same dimensions.
    Let me where to paste it and what original code to remove or comment out so the slider can display correctly above the nav and under the site title and search box..if you are familiar with 20/11 theme then basically I want the slider where the header images are placed. Help

    The header code looks like…

    </head>
    
    <body <?php body_class(); ?>>
    <div id="page" class="hfeed">
    	<header id="branding" role="banner">
    			<hgroup>
    				<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    				<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
    			</hgroup>
    
    			<?php
    				// Check to see if the header image has been removed
    				$header_image = get_header_image();
    				if ( $header_image ) :
    					// Compatibility with versions of WordPress prior to 3.4.
    					if ( function_exists( 'get_custom_header' ) ) {
    						// We need to figure out what the minimum width should be for our featured image.
    						// This result would be the suggested width if the theme were to implement flexible widths.
    						$header_image_width = get_theme_support( 'custom-header', 'width' );
    					} else {
    						$header_image_width = HEADER_IMAGE_WIDTH;
    					}
    					?>
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    				<?php
    					// The header image
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    							$image[1] >= $header_image_width ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    					else :
    						// Compatibility with versions of WordPress prior to 3.4.
    						if ( function_exists( 'get_custom_header' ) ) {
    							$header_image_width  = get_custom_header()->width;
    							$header_image_height = get_custom_header()->height;
    						} else {
    							$header_image_width  = HEADER_IMAGE_WIDTH;
    							$header_image_height = HEADER_IMAGE_HEIGHT;
    						}
    						?>
    					<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
    				<?php endif; // end check for featured image or standard header ?>
    			</a>
    			<?php endif; // end check for removed header image ?>
    
    			<?php
    				// Has the text been hidden?
    				if ( 'blank' == get_header_textcolor() ) :
    			?>
    				<div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
    				<?php get_search_form(); ?>
    				</div>
    			<?php
    				else :
    			?>
    				<?php get_search_form(); ?>
    			<?php endif; ?>
    
    			<nav id="access" role="navigation">
    				<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
    				<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
    				<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
    				<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
    				<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
    				<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    			</nav><!-- #access -->
    	</header><!-- #branding -->
    Thread Starter qmic76

    (@qmic76)

    Please can someone help me with the template tag placement for this theme

    Thread Starter qmic76

    (@qmic76)

    One last thing, I think the first initial code I gave you was the wrong part I showed you, I gave you the portion that related to the top-menu in header.php, when I should have gave you the portion that relates to the header-menu that is further down in the file. It looks like this..

    <?php wp_nav_menu(array(
    				'container' => '',
    				'theme_location' => 'header-menu')
    				);
    		?>

    I think I should have given you this first before you came up with a login/out snippet for me to use, and that’s why I’m having all these issues it the top-menu showing up when I don’t want one to begin with. I still will create a ‘members’ menu I know but if you get were I’m going with this, then post the ammend code snippet that you gave 3 weeks ago that will effect this code I showing now. Its just down dawned on me sorry. So i’ll need that log in/log out solution you gave me but not for the top-menu code I gave you in the initial post but for this header-menu code I’m posting now, I think that’s why its creating a top menu and all my results are showing in the top-menu area about the header menu, I’m I right…

    Thread Starter qmic76

    (@qmic76)

    OK, this is what I have in the admin/appearance/menu before you told me that last response..

    It says my theme supports up to 4 menus under “Theme Location”
    For top-menu I have nothing in it
    For header-menu I have nothing in it
    For sub-header I have nothing in it
    For footer-menu I have nothing in it.

    Now remember the ‘members’ menu I created is not assigned to any theme location at this point which is why all the links show up, I would play it with..I would assign ‘members’ to Header-menu under theme locations in admin/appear/menus, but then only the two links I want to show when a member is logged in shows up even on log out state, so that’s why I took ‘members’ out of header-menu and reverted back to all the links showing until I found a solution.

    The only menu I created per your request was ‘members’ from the earlier post, I did not create ‘not logged in’ menu, should I create one which would include all the not logged in links and then assign it the ‘Header-menu’? And then if that is so, where do I assign the ‘members’menu you had me make or do I leave it unassigned (not put in any of the 4 theme location menu spots)

    Thread Starter qmic76

    (@qmic76)

    Ok I remove it, It wasn’t my admin account pass/loggin anyway. I just created that for you to see what I’m talking about if I didn’t explain the issue properly, I’m sorry. Any insight?

    Right now i’m trying to remove the top-menu it created and have the function effect the member’s menu so any help with that would be great thanks

    Thread Starter qmic76

    (@qmic76)

    Great i’m getting somewhere using the amended debugging code you provided. Now I can see the “RESULT IS..(not logged or logged in) based on log in status, but now it also created a duplicate menu above my main navigation in the (top-menu) space of the screen (upper right), which I don’t want. The main navigation looks the same still all the links shown regardless of log in state, but when I log in or out the duplicate “top nav” it made does show only “member and project” in the menu when the user is logged in, I just want this to happen to my primary nav in the header…if your confused visit my site at mks76.com/wp/

    Thread Starter qmic76

    (@qmic76)

    vtxyzzy,

    I tried taking out the nesting and I also added echo statements to see if the function is even being called and none of the echo statements would show, letting me know that the function is not being called at all. Are you sure I do not need to add any code to functions.php. I’ve already created the members menu which includes the links I want to show when users are logged in.

    Heres what my code looks like now..

    <?php if (has_nav_menu('top-menu', 'responsive')) { ; ?>
    
    	        <?php
    			$result = is_user_logged_in();
    			echo "RESULT IS $result<br />";
    
    			if ( is_user_logged_in() ) {
    				echo "I AM LOGGED IN";
      				 wp_nav_menu(array( 'container' => '',
         				 'menu_class' => 'member-menu',
         				 'menu'  => 'Members')
       				);
    				} else {
    				echo "NOT LOGGED IN";
      				 wp_nav_menu(array( 'container' => '',
         				 'menu_class' => 'top-menu',
          				'theme_location'  => 'top-menu')
       				);
    			}
    		?>

    I even created a top-menu along with member menu to see if that would work but it didn’t so I went back just having the one members menu.

    Thread Starter qmic76

    (@qmic76)

    ok this is the complete header div code below you gave me nested, is there anything else I should change or take out?

    <div id="header">
    
            <?php if (has_nav_menu('top-menu', 'responsive')) { ?>
    
    	        <?php if ( is_user_logged_in() ) {
      				 wp_nav_menu(array( 'container' => '',
         				 'menu_class' => 'member-menu',
         				 'menu'  => 'Members')
       				);
    				} else {
      				 wp_nav_menu(array( 'container' => '',
         				 'menu_class' => 'top-menu',
          				'theme_location'  => 'top-menu')
       				);
    			}
    		?>
    
            <?php } ?>

    Then I made two menus named…
    “top-menu” that has “about and register” shown for nav links
    “members” that has “members and projects” shown for nav links
    Both of these menus I dragged/clicked the corresponding pages then I saved the menus to be in the header region of the page. I then created a “dummy user” to sign up on a different browser to be on the safe side.

    On first load/display..about and register is shown in primary nav, then when logging in with the “dummy user” login, it still displays “about and register” not switching to the members menu..what I’m missing or doing wrong? When I first tried your suggestion I only created the one ‘members’ menu and clicked on ‘member and project’ pages to be linked to that menu and that didn’t work so I tried to create two menus and no luck..

    Thread Starter qmic76

    (@qmic76)

    Thanks for your help but I’m still a little confused.

    I’ve implemented the code to header.php. But I’m not sure what you mean about creating a “Member” menu. I go to appearance/menus/ then I created a menu called “Members” but what pages should I include the ‘members’ menu?

    The first time I created the ‘members’ menu after you suggested it, I only included the pages that should be seen by members once they are logged in (members and projects). When I reloaded and logged out to check it, it only shows “members and projects” in the primary nav even though I’m logged out when it should be showing ‘about and register’ and only show ‘member and projects’ after logging in. I’m confused, am I not making the menu correctly or should there more code to defect login status in header.php or even functions.php (I did not change anything in functions.php based on your first response). As of right now its not defecting the login status change to switch between the 2 navigation displays. Please help

    Sorry I forgot to post what my header.php code looks like for the Responsive theme 1.4.9

    <?php if (has_nav_menu('top-menu', 'responsive')) { ?>
    	        <?php wp_nav_menu(array(
    				    'container'       => '',
    					'menu_class'      => 'top-menu',
    					'theme_location'  => 'top-menu')
    					);
    				?>
            <?php } ?>

    I remember you gave two code snippets to replace one for functions.php and the other for header.php. Please help

    I’m having the same issue as “”
    I’m using WordPress Theme Responsive 1.4.9 and in the functions.php the code looks different then the twenty ten theme she’s using it looks like this..

    `register_nav_menus(array(
    ‘top-menu’ => __(‘Top Menu’, ‘responsive’),
    ‘header-menu’ => __(‘Header Menu’, ‘responsive’),
    ‘sub-header-menu’ => __(‘Sub-Header Menu’, ‘responsive’),
    ‘footer-menu’ => __(‘Footer Menu’, ‘responsive’)
    )
    );`

    What is the add/replace php code snippet for this theme to achieve hiding member only page links in the primary nav (in my case top menu/header menu). Please help and I’m at a total loss.

    Thanks

    Mike

Viewing 11 replies - 1 through 11 (of 11 total)