How to add Custom post type Featrued Image in Site-wide Activity?
-
I tried to find a way to search, but many codes did not work properly.
Do not bring a distinctive image links.Where is the wrong in this code?
function record_cpt_activity_content_featured_image( $cpt ) { if ( 'new_product' === $cpt['type'] ) { global $wpdb, $post, $bp; $theimg = wp_get_attachment_image_src( get_post_thumbnail_id( bp_get_activity_secondary_item_id() ) ); $cpt['content'] .= '<img src="' . $theimg[0] . '">'; } return $cpt; } add_filter('bp_after_activity_add_parse_args', 'record_cpt_activity_content_featured_image');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.