Duplicating and renaming the Post Caroussel module

Hi,

when copying a module (with its own foldername) to a theme in the fl-builder/modules/ folder, and changing the classname and the FLBuilder::register_module entry with the new classname, the module should be visible right?

Hey Marcel!

Yes, that should override the existing module as outlined in Overriding Built-In Modules.

Jun

One addition, to load the new module, hook it to init:

add_action('init', 'load_custom_post_carousel_module');
function load_custom_post_carousel_module() {
	if ( class_exists( 'FLBuilder' ) ) {
		require_once 'fl-builder/modules/post-carousel-nolink/post-carousel-nolink.php';
	}
}

Hey Marcel,

Did you want to create a separate Post Carousel module? Or override the current one?

Ben

Ben,

A little bit of both. Here’s what I did to create a custom Post Carousel module:

  • Copied the Post Carousel module to theme folder
  • Renamed the main php file
  • Renamed the class
  • Modified the line with register_module, to use the new classname
  • And finally added the snippet in my previous post