我想定制我的个人帖子。我举了一个例子,说明我正在努力实现以下目标。我会为这个做一个定制的帖子模板吗?如果是这样的话,我怎么做呢?还是应该添加到我的single.php中?提前谢谢。
我想让我的个人主页看起来像什么。我想要两张并排的图片,这是整个页面的宽度。文本。一张图片,它是整个页面的宽度。文本。有一张图片从页面的左边开始,旁边有文本。然后是一张全宽的图片。

这是我的single.php
<?php
get_header();
the_post_thumbnail('banner-image');
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<article class="post">
<?php wpb_set_post_views(get_the_ID()); ?>
<div class="post-info">
<h1 class="post-title"><?php the_title(); ?></h1>
<h2 class="post-date"><?php echo strip_tags(get_the_term_list( $post->ID, 'location', 'Location: ', ', ', ' • ' ));?><?php the_date('F m, Y'); ?></h2>
</div>
<div class="post-content"><?php the_content(); ?></div>
<?php comments_template(); ?>
</article>
<?php endwhile;
else :
echo '<p>No content found</p>';
endif;
get_footer();
?>任何洞察力都会有帮助。我知道我想要它的样子,我只是不知道如何实现它。
发布于 2017-01-02 00:53:59
通常我会和自定义邮政类型一起去。因此,如果您创建自定义post类型moon,则将创建single-moon.php文件。
在那里,你会像你解释的那样创建一个组织。这使你有别于正规职位。
实际上,您需要处理您的moon CPT,并将自定义字段添加到您的定制post类型中。无论是acf还是cmb2都会为你工作。
我不喜欢后置格式的想法,以下是2017年青少年的样子。
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'audio',
) );因为他们是一天in和另一天out。我觉得他们不像CPT那么受欢迎。
发布于 2017-01-02 01:45:18
截至wordpress 4.7页模板支持在任何帖子类型,包括“帖子”。因此,您可以创建一个页面模板,并在您想要的帖子中使用它。https://developer.wordpress.org/themes/template-files-section/page-templates/
https://wordpress.stackexchange.com/questions/250961
复制相似问题