Jump to content

godrob

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

godrob's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I just worked it out after you posted. Thanks anyway for taking the time to reply - appreciated!
  2. Hi guys, I'm pretty new to PHP and could really do with some help please. All I want to do is wrap the code below in a simple IF statement. Basically it control the menu code which I want to hide on a certain page. <ul class="sf-menu"> <?php if ( has_nav_menu( 'primary-menu' ) ) { ?> <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary-menu', 'items_wrap' => '%3$s' ) ); ?> <?php } else { ?> <?php wp_list_pages( 'title_li=&depth=3' . bp_dtheme_page_on_front() ); ?> <?php } ?> </ul> So I tried doing something like this: <?php if (is_page('Contact')) { // Disable Main Menu } else { <ul class="sf-menu"> <?php if ( has_nav_menu( 'primary-menu' ) ) { ?> <?php wp_nav_menu( array( 'container' => false, 'menu_id' => 'nav', 'theme_location' => 'primary-menu', 'items_wrap' => '%3$s' ) ); ?> <?php } else { ?> <?php wp_list_pages( 'title_li=&depth=3' . bp_dtheme_page_on_front() ); ?> <?php } ?> </ul> } ?> ...But I get an error: Parse error: syntax error, unexpected '<' on this line <ul class="sf-menu"> Anyone out there tell me what I'm doing wrong please? Many Thanks Rob
  3. Don't worry, I've worked it out... I simply added !is_single() Easy when you know how
  4. Hi Guys, I'd be grateful if one of you could help me out here please? Basically the code below redirects non-logged in users to my login page unless they access a page specified in the array below. This all works just fine. However, what I'd also like to achieve is for non-logged in users to be able to access any blog posts, too. Any Wordpress guru's able to help me out here? <?php if(!is_user_logged_in() AND (!is_front_page() AND (!is_page( array (49, 57, 1796, 2017, 2951,686, 693, 675, 683, 689, 3063, 3477, 3649, 3989, 2576, 1773, 1784, 2700, 2706, 1791, 2709, 1778, 2703, 4115) ) ) ) ) { // wp_redirect('/index.php'); $redirect = home_url() . '/wp-login.php?redirect_to=' . urlencode( $_SERVER['REQUEST_URI'] ); wp_redirect( $redirect ); exit; } ?> Thanks for any help Rob.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.