Category Featured Image
-
I need help making default images for each of my categories. I tried your snippet of php code for the functions file, but it seemed to break the site. Here is the snippet I pasted at the end of my functions.php file:
function dfi_category( $dfi_id ) { if ( has_category( 'commodities' ) ) { return 157531; // the image id } else if ( has_category( 'dividends-income' ) ) { return 157533; // the image id } else if ( has_category( 'etfs' ) ) { return 157540; // the image id } else if ( has_category( 'forex' ) ) { return 157543; // the image id } else if ( has_category( 'investing' ) ) { return 157549; // the image id } else if ( has_category( 'market' ) ) { return 157553; // the image id } else if ( has_category( 'personal-finance' ) ) { return 157560; // the image id } else if ( has_category( 'real-estate' ) ) { return 157563; // the image id } else if ( has_category( 'retirement' ) ) { return 157571; // the image id } else if ( has_category( 'stocks' ) ) { return 157575; // the image id } else if ( has_category( 'trading' ) ) { return 157578; // the image id } else if ( has_category( 'us-world-news' ) ) { return 157730; // the image id } return $dfi_id; // the original featured image id } add_filter('dfi_thumbnail_id', 'dfi_category' );
Please help!
https://www.ads-software.com/plugins/default-featured-image/
- The topic ‘Category Featured Image’ is closed to new replies.