Follow this documentation if you need to implement a shortcode in the Posts module. This guide demonstrates how it's possible to implement a plugin shortcode in the Posts module to create dynamic elements in thumbnails using Uncode Custom Fields.
In this specific case, the 'HurryTimer PRO' plugin was used to create the dynamic Countdown elements with the plugin shortcodes, but this example can be applied to various scenarios.
Implementation Steps
- First, create a Custom Field in the specific Post Type, in this case named 'Countdown', screenshot ;
- Activate the Custom Field in the Posts Module, screenshot ;
- Insert the shortcode in the 'Countdown' Custom Field on the page, screenshot ;
- Implement this code in your Child Theme's functions.php file:
function uncode_child_get_layout_cf_val( $get_cf_value ) { $get_cf_value = do_shortcode( $get_cf_value ); return $get_cf_value; } add_filter( 'uncode_get_layout_cf_val', 'uncode_child_get_layout_cf_val', 10 );
Now the Countdown created through the Custom Field that reads a dynamic shortcode is visible in the thumbnails generated by the Posts Module, screenshot .
Comments
0 comments
Article is closed for comments.