WordPress.org

Ready to get started?Download WordPress

Forums

Sharedaddy
Posts Only and Custom Post Types (6 posts)

  1. karenalenore
    Member
    Posted 3 years ago #

    I love this plugin but just need a little more control. Any suggestions are appreciated even if I have to hack the code a bit.

    How do I get it to show only on posts? NOT pages.

    Also, can I restrict certain custom posts types from displaying the share bar?

    I thought perhaps if I stop it from auto inserting and instead let put the code in the template myself, I could get enough control to make it work. Any suggestions on how to do that?

  2. John Godley
    Member
    Plugin Author

    Posted 3 years ago #

    Eventually the plugin will provide more control, but for now you can use the filter sharing_show to return true or false if you want the current page to display sharing buttons.

  3. kemch
    Member
    Posted 3 years ago #

    How would this be used in on a page template?

  4. karenalenore
    Member
    Posted 3 years ago #

    John - Thanks for the heads up! I didnt even see that option at the bottom of the edit page. Even better as there are some pages I'd like to share and other's I would not.

    Kemch - there is a checkbox at the very bottom of each page when you are editing it to show or hide the sharing. Not sure if that answers your question, but it's not really a template issue and don't know if you can preset that option by template or not.

  5. kemch
    Member
    Posted 3 years ago #

    What I wanted to do was have a home page that did not show the any sharing, but just simple excerpts of a couple of the most recent posts To accomplish this, I added this to the top of my home.php template.

    <?php function no_sharing() {
    }
    add_filter('sharing_show', 'no_sharing');
    ?>

    I'm not sure why I had to make an empty function, but that's the only way I got it to work.

  6. Mike Burns
    Member
    Posted 2 years ago #

    Is there any progress on the functionality Karenalenore describes above?

    The per-page option is nice, but in a situation where you are activating this plugin on an established site with a significant amount of pages (around 600 in my case) it would be nice to globally exclude pages and/or custom post types by default through the settings page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags