如何在WP帖子模板插件中默认检查帖子的自定义模板



>我正在使用WP帖子模板作为帖子模板

我有两个模板

    默认
  • 模板(默认选中(
  • 财产

我想要

  • 默认模板
  • 属性(默认选择(

您需要将代码更改为page.php文件。在同一文件上找到以下代码。

while ( have_posts() ) : the_post();
        get_template_part( 'template-parts/page/content', 'page' );
            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) :
                comments_template();
            endif;
        endwhile; // End of the loop.

请将此行get_template_part( 'template-parts/page/content', 'page' );更改为

get_template_part( 'inc/template', 'property' );

为此,您需要将模板文件名设置为模板属性.php

最新更新