UX builder has an element blog_posts which would be handy to be used for another custom post type. But there is no option to select another than posts. The solution is to create a new shortcode, based on the blog_posts shortcode.

UX Builder Shortcodes

If you are familiar with Flatsome, you know that any UX builder element can be used as a retrieved shortcode in WordPress Editor, as a ‘behind the scene’ option. All shortcodes can be used with copy-paste in any place they are needed.

How to generate a new shortcode?

The most simple way is to change an existing shortcode.

Follow this path to find the file for the shortcode needed: \inc\shortcodes\

For each element, there is a function with all customization needed. Starting with a blog_posts shortcode, I used it for a custom post type named testimonials, creating a new function.

How to override this file correctly in order to be safe for future updates?

The easiest way – but not safe for updates – is to create a new php file (testimonials_posts.php) and then call it in the init.php file

The inc folder can’t be overridden/retrieved in Child Theme. To override an existing shortcode, it has to be unregistered and registered again with the new changes. But, as I created a new shortcode, based on an existing one, I used the code to register the new shortcode in a custom plugin.

Here is the final version, where added manually some customization based on the original blog_posts shortcode:

Similar Posts