When i place custom code
-
Hi, I can see from your plugin that if an image has not been uploaded to a post… the post can have an image, specific to the category it is in…
I have tried adding the to my functions.php but it gives me an error, even before I upload it… Am I placing it in the wrong place?
Kind regards
Gary
function dfi_category ( $dfi_id, $post_id ) { // all which have 'animals' as a category if ( has_category( 'animals', $post_id ) ) { //sub category if ( has_category( 'cats', $post_id ) ) { return 7; // cats img } else if has_category( 'dogs', $post_id ) { return 8; // dogs img } return 6; // default animals picture } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_category', 10, 2 );
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘When i place custom code’ is closed to new replies.