How to override archive template

How to override archive template

In order to override the Archive Template files, please follow the steps mentioned below:

  1. Copy your template file – wp-content/plugins/wp-event-manager/templates/content-event_listing_category.php
  2. Paste the file in your child theme: wp-content/themes/YOUR-THEME/wp-event-manager/content-event_listing_category.php

Enter the following code in the functions.php file

  1. add_filter( 'archive_template', 'wpem_event_archive', 20 );
  2. function wpem_event_archive($template)
  3. {
  4. if ( is_tax( 'event_listing_category' ) ) {
  5. $template = get_template_directory() . '/wp-event-manager/content-event_listing_category.php';
  6.     }
  7.     elseif ( is_tax( 'event_listing_type' ) ) { 
  8. $template = get_template_directory() . '/wp-event-manager/content-event_listing_type.php';    
  9. }
  10.     return $template;
  11. }

Or,

You can simply rename the archive template file while pasting it in the Child theme

  1. Copy your template file – wp-content/plugins/wp-event-manager/templates/content-event_listing_category.php
  2. Paste the file in your child theme: wp-content/themes/YOUR-THEME/wp-event-manager/taxonomy-event_listing_category.php (rename template).


    • Related Articles

    • Enabling Full Template Support

      WP Event manager uses custom post types, therefore, post archives can be enabled and fully themed. You can create template files for archives of events using WordPress Template Hierarchy. Note: For the single event listings, WP Event Manager by ...
    • Template Files Override

      In this guide, we will show you how you can customize or edit single event listing pages. WP Event Manager plugin has a templates directory that contains all the template folders. This template folder includes form-fields directory. Overriding ...
    • Create single event template with Elementor Pro

      Elementor Pro is the advanced and paid version of the Elementor plugin. It enables users to access premium features for developing a web page template. One needs to follow the below-mentioned steps to develop a dynamic single event template on ...
    • List of all the default template and fields given in core and Premium Add-ons

      The default templates offered by WP Event Manager are mentioned below. The default fields & default template available in the core plugin are as follows: WP-Event-Manager Account-signin.php Content-event_listing.php Content-no-events-found.php ...
    • Enable Trace and Debug Javascript file logs

      Enable or disable debugging and trace javascript and other files with the Event log Plugin. Installation You can install Event Logs plugin using 2 different ways: Automatic Installation: You can install a plugin from the backend of your WordPress. ...