Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何在WP Post template插件中默认检查自定义模板中的帖子_Wordpress_Wordpress Theming - Fatal编程技术网

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

Wordpress 如何在WP Post template插件中默认检查自定义模板中的帖子,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我使用可湿性粉剂后模板后模板 我有两个模板 默认模板(默认选中) 财产 我想要 默认模板 属性(默认情况下选择) 您需要将代码更改为page.php文件。在同一文件中查找以下代码 while ( have_posts() ) : the_post(); get_template_part( 'template-parts/page/content', 'page' ); // If comments are open or we have at l

我使用可湿性粉剂后模板后模板

我有两个模板

  • 默认模板(默认选中)
  • 财产
我想要

  • 默认模板
  • 属性(默认情况下选择)

您需要将代码更改为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' );

为此,您需要设置模板文件名为template property.php

您尝试了什么?你能用代码在这里发布这两个模板吗?这篇文章很有用吗?实际上,我希望代码将其默认设置为属性模板,而不是像这样