Method 1:
Step 1: Create a Custom Archive Template
- In your WordPress dashboard, navigate to “Templates” and then “Theme Builder.”
- Click the “Add New” button to create a new template.
- Choose the “Archive” option to create an archive template.
Step 2: Design Your Custom Archive Template
- In the Elementor editor, design your custom archive template using the drag-and-drop interface.
- Add and arrange widgets, sections, and elements to create the desired layout and design.
Step 3: Save the Custom Archive Template
- Once you’ve designed the custom archive template, click the “Save” button to save your changes.
- Give your template a meaningful name and click “Save” again.
Step 4: Assign the Custom Archive Template
- After saving the template, click the “Publish” button to make it live.
- A popup will appear with options to assign the template. Choose where you want the template to be applied. You can assign it to specific categories, tags, or other conditions.
Step 5: Verify the Custom Archive Template
- Visit the front-end of your website and navigate to one of the categories or archive pages that you assigned the custom template to.
- You should now see your custom archive template in action.
Step 6: Troubleshooting
If your custom archive template is not showing up as expected, make sure to check the following:
- Ensure that you have Elementor and a compatible theme installed and activated.
- Verify that you have assigned the custom template to the correct categories or conditions.
- Clear any cache or refresh your website to ensure changes take effect.
Step 7: Further Customization (Optional)
You can continue to edit and customize your custom archive template in Elementor anytime by going back to the Theme Builder and selecting the template you created.
Remember that the interface might vary slightly based on your theme and Elementor version. If you encounter any difficulties, refer to Elementor’s official documentation or seek support from their community or help resources.
Method 2:
Following code snippet customizes custom archive template for product pages using WordPress filters. It checks if the current page is a ‘product’ archive, then replaces the default template with ‘archive-product.php’ if found. This enhances display control.
add_filter( 'template_include', 'custom_archive_template', 99 ); function custom_archive_template( $template ) { if ( is_post_type_archive( 'product' ) ) { $new_template = locate_template( array( 'archive-product.php' ) ); if ( '' != $new_template ) { return $new_template ; } } return $template; }