• Resolved maryannk

    (@maryannkelley)


    I have a recipe plugin (WP Recipe Maker) installed which creates recipe cards as a CPT. Until recently, the default image was applying to the recipe cards if no image was set (which was the desired behavior). Recently, the default image is only applied to posts and not to the recipe cards/CPT. I don’t see a setting for individual post types in the plugin/media settings, and I’m not sure if I did something that broke this functionality or if it was an update. Is it possible to restore it if it was an update, or any ideas what might be conflicting if not? Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Maryannk,

    Sorry to hear that, I will investigate next week.

    If you are in a hurry you could test the older version of the DFI plugin:
    https://downloads.www.ads-software.com/plugin/default-featured-image.1.6.3.zip

    Jan-Willem

    Thread Starter maryannk

    (@maryannkelley)

    Thanks, Jan-Willem. I noticed that there was a similar issue on another support thread with WooCommerce which uses CPT, so I thought they might be related since both are CPTs. I look forward to hearing from you next week.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Maryannk

    I found the solution, WP Recipe Maker uses featured images but does not support it fully.

    create the following file: wp-content/plugins/wprm_recepie_thumbnails.php
    and add the following code:

    
    <?php
    /**
     * Plugin Name:       WPRM thumbnail support
     * Plugin URI:        https://www.ads-software.com/support/topic/default-image-for-cpt/
     * Description:       Enable thumbnails for WP Recipe Maker, so DFi can set it.
     * Version:           1.0.0
     * Requires at least: 5.2
     * Requires PHP:      7.2
     * Author:            Janw
     * Author URI:        https://janw.me/
     * License:           GPL v2 or later
     * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     */
    
    function wprm_recipe_post_type_arguments_thumbnail( $args ) {
    	$args['supports'][] = 'thumbnail';
    
    	return $args;
    }
    add_filter( 'wprm_recipe_post_type_arguments', 'wprm_recipe_post_type_arguments_thumbnail', 10, 2 );
    

    Don’t forget to activate the plugin.

    Let me know how it goes.

    Jan-Willem

    Thread Starter maryannk

    (@maryannkelley)

    That fixed it, thanks so much!

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Good to hear, let me know if you need anything else.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default image for CPT’ is closed to new replies.