Custom field check -please
-
Hi there
I have had another go getting custom fields to work in this this lovely Carousel.
I wanted to add an event date field and move the post title above the featured image (I found disabling the featured image in the settings and adding a new image from a custom field worked)
This is the code I ended up with which is working – but this is my first attempt at filters so I presume it is a bit of a mess….
function my_wpc_item_description( $description, $params ) { //get the startdate without the time $startdate = eo_get_the_start(); $post_content = get_the_content(); $the_image = get_field('my_photo'); $data_src = '<img src="' . $the_image . '" />'; $description = ' <div class="wp-posts-carousel-desc"> <div class="my-image"> ' . $data_src . ' . </div> <div class="the-date">' . $startdate . '</div> <div class="main-content"> ' . $post_content . '</div> </div>'; return $description; } add_filter('wpc_item_description', 'my_wpc_item_description', 1, 2);
Any guidance on improving this code would be appreciated
Thank You
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom field check -please’ is closed to new replies.