How can I extend the module class ET_Builder_Module_Featured_Posts_Slider to display custom post type instead of posts?
I have tried extending the class with new slug and use that as shortcode.
class HB_Builder_Module_Featured_Custom_Posts_Slider extends ET_Builder_Module_Featured_Posts_Slider {
function init() {
parent::init();
$this->template_name = 'module-featured-custom-posts-slider';
$this->slug = 'hb_pb_featured_custom_posts_slider';
}
function _pre_wp_query( $args ) {
$args = parent::_pre_wp_query( $args );
$args['post_type'] = 'boating-product';
return $args;
}
}
new HB_Builder_Module_Featured_Custom_Posts_Slider;
Steps To Reproduce
First I had errors complaining about undefined classes so I added those require statements
Problem Description
How can I extend the module class ET_Builder_Module_Featured_Posts_Slider to display custom post type instead of posts? I have tried extending the class with new slug and use that as shortcode.
Steps To Reproduce
First I had errors complaining about undefined classes so I added those require statements
Then I used
hb_pb_featured_custom_posts_slider
as shortcode in my child theme template but it didn't work