Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rajat Varlani

    (@the_champ)

    Hi there,
    Have you set a static page/post as homepage?
    If yes, follow the steps mentioned below:
    Find out the id of the page/post you have set as homepage as mentioned at following link:
    https://www.techtrot.com/wordpress-page-id/

    Then place following code in the “wp-content/themes/CURRENT_THEME/functions.php” and save the file back. CURRENT_THEME is your active theme.

    function the_champ_disable_sharing_homepage($post, $content){
    	if(isset($post -> ID) && $post -> ID == POST_ID){
    		return 1;
    	}
    	return 0;
    }
    add_filter('the_champ_bypass_sharing', 'the_champ_disable_sharing_homepage', 10, 2);

    Replace POST_ID in the code above with the post id of the page/post set as homepage.

    Above changes will not break with future updates.

    Thread Starter gawakamy

    (@gawakamy)

    Hi, thans for quick response.
    So, should I replace “POST_ID” with my static page id? For example,if the id is 2 then

    if(isset($post -> ID) && $post -> ID == 2){

    Like above?

    Plugin Author Rajat Varlani

    (@the_champ)

    Yes, exactly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable it on the page doesn't work.’ is closed to new replies.