WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts Thumbnails
Related Posts Thumbnails conflicts with custom post types using post thumbnails (3 posts)

  1. Josh Leuze
    Member
    Posted 3 years ago #

    Hi Mary, a user of my plugin Meteor Slides reported a conflict with your plugin related to the post thumbnails.

    The user has a theme installed that does not support post thumbnails, so the related post thumbnails are dynamically generated from the post's images.

    However, when the user activates Meteor Slides, Related Posts Thumbnails no longer dynamically generates these thumbnails.

    My plugin adds support for post thumbnails, but only to the custom post type that it creates, not for posts or pages.

    Is your plugin checking for any post thumbnail support, or specifically posts? Would it be possible for it to ignore post thumbnail support for custom post types, or to have dynamic thumbnails as an option even if post thumbnails are supported?

    http://wordpress.org/extend/plugins/related-posts-thumbnails/

  2. marynixie
    Member
    Plugin Author

    Posted 3 years ago #

    Hi JLeuze,

    In the last version 1.2.9 plugin now searches post body if there is no assigned Featured Image. This should fix this problem.

    I am using this function current_theme_supports to check if theme supports post-thumbnails. Is there a way to check this support for 'posts' post type only?

  3. Josh Leuze
    Member
    Posted 3 years ago #

    Hi Mary, in my plugin I am checking first to see if post thumbnails are enabled and whether they are in an array, like this:

    function meteorslides_featured_image_array() {
    
    		global $_wp_theme_features;
    
    		if( !isset( $_wp_theme_features['post-thumbnails'] ) ) {
    
    			$_wp_theme_features['post-thumbnails'] = array( array( 'slide' ) );
    
    		}
    
    		elseif ( true === $_wp_theme_features['post-thumbnails'] ) {
    
    			$_wp_theme_features['post-thumbnails'] = array( array( 'post','page', 'slide' ) );
    
    		}
    
    		elseif ( is_array( $_wp_theme_features['post-thumbnails'] ) ) {
    
    			$_wp_theme_features['post-thumbnails'][0][] = 'slide';
    
    		}
    
    	}

    So you could check for this if the 'posts' post type has been added as an array.

    It looks like this might get a bit simpler to do in 3.1, but I haven't had a chance to try it out yet.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic