Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author dFactory

    (@dfactory)

    Can you post a link to your site?

    Thread Starter mahii-conception

    (@mahii-conception)

    The website is https://etrelemeilleur.com but do I correctly override the files ?

    Plugin Author dFactory

    (@dfactory)

    What you did is one of the ways of overriding default templates.

    If you copied the files it will be used instead of the default ones, so you can freely customize it (however I suggest not to remove the action or filter hooks)

    But whe you copied the single-event.php you should also copy the content-single-event.php cos these two work together.

    The other way of customization is by adding / removing actions hooked to specific do_action functions in template files.

    Like this:

    // EM remove template actions
    function df_add_and_remove_actions() {
    	remove_action('em_before_main_content', 'em_breadcrumb', 20);
    	remove_action('em_get_sidebar', 'em_get_sidebar', 10);
    	remove_action('em_before_main_content', 'em_output_content_wrapper_start', 10);
    	remove_action('em_after_main_content', 'em_output_content_wrapper_end', 10);
    	remove_action('em_after_loop_event_title', 'em_display_loop_event_meta', 10);
    }
    add_action('wp' , 'df_add_and_remove_actions');
    // Do something in a template action
    function df_display_something() {
    	// do something
    }
    add_action('em_after_loop_event_title', 'df_display_something', 10);

    I’ve added the following code to my “content-single-event.php” before the “do_action(’em_after_single_event_title’)”. But Google Maps is still visible. What am I doing wrong?

    function df_add_and_remove_actions() {
    	remove_action('em_after_single_event_title', 'em_display_google_map', 40);
    }
    add_action('wp' , 'df_add_and_remove_actions');

    I also tried just

    remove_action('em_after_single_event_title', 'em_display_google_map', 40);

    Plugin Author dFactory

    (@dfactory)

    @timonw, you should add that code to functions.php. this is the way to do it without modifying plugin template files.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Override templates un theme folder’ is closed to new replies.