I want to add an archive.php file for a number of Custom post types. I realise that x-theme only uses index.php and I’m familiar with the WP Template Hierarchy. But I’m not that familiar with x-theme. I want to know if I should duplicate index.php to create my archive.php files, or use something else. I also want to know where I should locate the archive.php file so it take effect.
Hello There,
Default archive template is index.php at the root folder of the theme. You could just duplicate and rename it with your archive name. Then do the same with other template parts.
get_template_part() is wrapped by X’s function named x_get_view(). This allows to pick template parts based on stack (from specific folder locations). Please check X’s customization best practices.
So from the index.php:
<?php x_get_view( x_get_stack(), 'wp', 'index' ); ?>
That lines is calling wp-index.php from this folder: wp-content\themes\x\framework\views\{stack}
Hope this helps.
1 Like
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.