• Resolved Juanzo

    (@jmzolezzi)


    I’m placing socialite buttons on the theme itself, placing the following code:

    <?php echo $wpsocialite->wpsocialite_markup('small'); ?>

    Is there any way to hide that on specific posts ID? I’d like to hide the share buttons on some posts / pages, but the plugins that have this feature are not as good performance-wise as this one 🙂

    http://ww.wp.xz.cn/extend/plugins/wpsocialite/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tom Morton

    (@tm3909)

    First,

    Be sure to upgrade to the latest version. The new manual markup is <?php wpsocialite_markup(); ?>

    Second,

    Let me think about how to best implement a “hiding” function. For now, you could simply use something like this:

    <?php
    		$exclude_ids = array('1','60','62');
    		if(!in_array($post->ID, $exclude_ids)){
    			wpsocialite_markup();
    		}
    		?>

    This looks at the ID’s you have specified in $exclude_ids, then says “If the current $post->ID is not one of these, then display the wpsocialite_markup function.”

    Let me know if that helps.

    Thread Starter Juanzo

    (@jmzolezzi)

    That works perfectly well Tom, thanks!

    Hi Tom

    Does that code go in functions.php? Any particular place? I’m using Genesis and looking to exclude from pages such as http://educulture.com/newsletter-signup-successful/

    Ta
    KB

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hide socialite on specific posts’ is closed to new replies.