• I’m trying to customise the carousel with the wpc_item_description filter in functions.php, but it seems like functions like get_field won’t work there – the page stops rendering at the point where I call it. What am I missing?

    function my_wpc_item_description( $description, $params ) {
    
    	$post_content = get_the_content();
    	$topic = get_field('topic-name');
    
    	$description = '<div class="wp-posts-carousel-desc">
    <div class="main-content"> ' . $topic . '</div>
    </div>';
    
    	return $description;
    }
    add_filter('wpc_item_description', 'my_wpc_item_description', 1, 2);
    • This topic was modified 7 years, 1 month ago by Spiralli.
    • This topic was modified 7 years, 1 month ago by Spiralli.
  • The topic ‘using the_field in filters’ is closed to new replies.