WordPress.org

Ready to get started?Download WordPress

Forums

Digg Digg
Custom post types and exclusion (3 posts)

  1. Martin
    Member
    Posted 2 years ago #

    WordPress can use a great many combinations of different content to acheive a site owners desired look and feel.

    Custom Post Types is one and one that's been in core for some time now.

    When trying out the Digg Digg plugin, I noticed that the floating tool bar appeared 3 times on a page!

    https://skitch.com/billrastarr/8y9gi/new-site-and-pics-build-20111220165912

    On closer inspection, they are there as the theme and page uses custom post types (blocks) for the layout.

    The real issue here is I'm unable to untick anything to disable the toolbar from these as the plugin is ignorant of custom post types nor am I able to remove it from specific pieces of content.

    - Can you please scan for custom post types and allow these to be allowed or disallowed for display?
    - Would be great to also be able to do the same for a piece of content in the content edit screen.
    - And fixing Pinterest so a user is presented with a list of page media would be fantastic. Not much point for Pinterest to be displayed otherwise, is there?

    Thanks for the work on the plugin. I'm interested to see how much Buffer has on content distribution.

    http://wordpress.org/extend/plugins/digg-digg/

  2. Cliff Seal
    Member
    Posted 2 years ago #

    Just add this to your functions.php file:

    if ( get_post_type() != 'post' ) {
        remove_filter('the_excerpt', 'dd_hook_wp_content');
        remove_filter('the_content', 'dd_hook_wp_content');
    }

    That keeps it from loading on any post type except, explicitly, posts. You can edit this to suit your needs.

  3. Cliff Seal
    Member
    Posted 2 years ago #

    Scratch that—it removes it from actual posts, too.

    Instead, I had to put the following in the post type template, just after get_header();:

    remove_filter('the_excerpt', 'dd_hook_wp_content');
    remove_filter('the_content', 'dd_hook_wp_content');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags