最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Overriding the template files using a plugin for all themes

programmeradmin0浏览0评论

I believe these are the common filters to use when overriding a template

  1. template_include
  2. single_template
  3. page_template
  4. archive_template

The works but it seem that they are theme depended. I am using a theme called hello elementor from WordPress it is calling index.php as a blog archive template. So i tried to override that with archive_template but it does not work. I tried template_include which works but it overrides other templates of single and page templates also.

is_archive() returns

If the theme had archive.php I belive archive_template would have worked. So what's the method I should go for to make it work with all themes?

发布评论

评论列表(0)

  1. 暂无评论