• Resolved thetravelgal

    (@thetravelgal)


    I used the coding
    remove_filter( ‘the_content’, ‘A2A_SHARE_SAVE_add_to_content’, 98 );
    add_filter( ‘the_content’, ‘A2A_SHARE_SAVE_add_to_content’, 39 );
    to my functions.PhP to move the share buttons above the related posts instead of below
    HOWEVER
    Now it gives me the sharing buttons both where I want them above the related posts AND in the original spot below. (On pages it gives me two sets right above each other.)

    How do I make the lower set (the original default set) go away?!?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author micropat

    (@micropat)

    Use the following code instead:

    function addtoany_before_my_related_posts( $query ) {
    	remove_filter( 'the_content', 'A2A_SHARE_SAVE_add_to_content', 98 );
    	
    	if ( $query->is_main_query() && is_singular() ) {
    		add_filter( 'the_content', 'A2A_SHARE_SAVE_add_to_content', 39 );
    	}
    }
    add_action( 'pre_get_posts', 'addtoany_before_my_related_posts' );

    And adjust the 39 number as needed.

    Thread Starter thetravelgal

    (@thetravelgal)

    THANK YOU! That worked perfectly!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Move buttons to above Jetpack related posts w/out duplicate share buttons’ is closed to new replies.