latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Alternate Menu for members question

Home Forums Community Forum Alternate Menu for members question

This topic contains 1 reply, has 2 voices. Last updated by  Bruce 3 years, 7 months ago.

Topic Author Topic
Posted: Wednesday Jun 5th, 2013 at 12:25 pm #51417
LGMTL
Username: leegraphics

Hi,

Following up to the Alternate Menu for members – part 2 tutorial located here: https://www.s2member.com/forums/topic/alternate-menu-for-members-part-2/

I had a question because the template I’m using has different code for the header.php.

This part:

then in your header.php file replace

 'primary' ) ); ?>

with

 'logged-in-menu' ) );
} else {
    wp_nav_menu( array( 'theme_location' => 'logged-out-menu' ) );
}
?>

Doesn’t seem to apply to my case, I have the following code and was wondering how I should change it, it’s in a file called header-extensions.php instead of header.php

'primary',

		'container'         => '',

		'items_wrap'        =&gt; '<ul class="root">%3$s</ul>' 

	);

	echo '<nav id="access" class="clearfix">

			<div class="container clearfix">';

		wp_nav_menu( $args );

	echo '</div><!-- .container -->

			</nav><!-- #access -->';

}

else {

	echo '<nav id="access" class="clearfix">

			<div class="container clearfix">';

		wp_page_menu( array( 'menu_class'  =&gt; 'root' ) );

	echo '</div><!-- .container -->

			</nav><!-- #access -->';

}

	?&gt; 		

Thanks for your help.

Regards,

FL

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Jun 6th, 2013 at 8:31 am #51492
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

This code that you posted is essentially the same as the example. However it’s been split into multiple parts, and placed between some HTML code. An example of how you might change this code below:

<?php
		echo '<nav id="access" class="clearfix">

				<div class="container clearfix">';
				
			if ( is_user_logged_in() ) {
			    wp_nav_menu(array('theme_location' => 'logged-in-menu', 'container' => '', 'items_wrap'  => '<ul class="root">%3$s</ul>' ));
			} else {
			    wp_nav_menu(array('theme_location' => 'logged-out-menu', 'container' => '', 'items_wrap'  => '<ul class="root">%3$s</ul>' ));
			}

		echo '</div><!-- .container -->

				</nav><!-- #access -->';

This will probably need to be altered for your uses, but this should give you an idea of what’s going on.

That’s about as far as we can go with custom code. If you need further assistance, we recommend http://jobs.wordpress.net, or another freelance web site where WordPress® experts are offering their expertise through a bid on your project.
Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.