• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Authority Pro – Remove Social Menu From Specific Pages

This tutorial provides the steps to modify the code so you can conditionally remove the social menu from specific pages in Authority Pro.

Based on this question from a member of the Genesis community :

I need to conditionally remove / hide the Social Menu (along left hand side of page) for a specific page. The conditional argument is no problem, however I cannot find the hook for the social menu and the do_action argument for the social menu.

Demo Video #

Shows how to add a conditional tag to the existing function authority_do_social_menu in order to remove the social menu from displaying on specific pages.

Code Modification #

Before
After

In the Authority Pro themes functions file, you’ll find the PHP code for the social menu between lines 276 – 293 which adds the third menu on all pages of the Authority Pro theme.

add_action( 'genesis_before_header', 'authority_do_social_menu', 9 );

function authority_do_social_menu() {

	echo '<h2 id="additional-menu-label" class="screen-reader-text">' . __( 'Additional menu', 'authority-pro' ) . '</h2>';

	genesis_nav_menu(
		array(
			'theme_location' => 'social',
			'depth'          => 1,
		)
	);

}

There’s only 1 step. Add your conditional tag after the function name like you see in the following modified code :

add_action( 'genesis_before_header', 'authority_do_social_menu', 9 );

function authority_do_social_menu() {

    if ( is_front_page() ) 
    return;

	echo '<h2 id="additional-menu-label" class="screen-reader-text">' . __( 'Additional menu', 'authority-pro' ) . '</h2>';

	genesis_nav_menu(
		array(
			'theme_location' => 'social',
			'depth'          => 1,
		)
	);

}

In this case, we’ve added the following conditional check to remove the social menu from the front page :

if ( is_front_page() ) 
    return;

You can swap out the is_front_page conditional tag and use any other conditional tag to remove the social menu from any page or post.

Authority Pro Theme Nav Menu

Reader Interactions

Comments

  1. Brad Dalton says

    November 18, 2018 at 4:18 am

    Test

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.