WordPress.org

Ready to get started?Download WordPress

Forums

Simple Likebuttons (Facebook, Google+, Twitter, ...)
[Plugin: Simple Likebuttons (Facebook, Google+, Twitter)] Disable pages or posts (2 posts)

  1. Flar
    Member
    Posted 2 years ago #

    Hi,

    you already wrote, that you can disabale the likebuttons on pages or posts? How can I do that? Can you please give me an example?

    Many Thanx!

    This is your code:

    //Only show at a single post / page the extended (if configurated) view
      if(is_single() or is_page()) {
        return $strContent . getLikeButtonsHtmlCode();
      } else {
        return $strContent . getLikeButtonsHtmlCode('small');
      }
    }

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    http://wordpress.org/extend/plugins/simple-likebuttons/

  2. Flar
    Member
    Posted 2 years ago #

    I think I got it, with this code I can disable the buttons on post ids 3600, post id 7580 and on all pages:

    //Add icons method
    function add_simple_likebuttons($strContent) {
    
      //Only show at a single post / page the extended (if configurated) view
    
    if(is_single('3600') or is_single('7580') or is_page()){
        return $strContent;
      } else {
        return $strContent . getLikeButtonsHtmlCode();
      }
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic