Default image for pages.
-
You helped me before on displaying a default image for a featured image. But now I need a default image for an Advance Custom Field. When I try this code it does give me what I want but it is also showing up on a custom post type of mine that is empty. I’m not sure how to restrict it to just pages. Here is the code I tried:
[ Moderator note: Code fixed, please wrap code in backticks or use the code button. ]
// Provide default image for header image in a page - Admin Columns Plugin function phb_cac_column_header_image_value( $value, $postid, $column ) { if ( $column->properties->type == 'column-meta' ) { if ( ! $value ) { $value = '<img src="' . PHB_URL . '/images/no-header-image.png" />'; //link to default image } } return $value; } add_filter( 'cac/column/meta/value', 'phb_cac_column_header_image_value', 10, 3 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Default image for pages.’ is closed to new replies.