创建单独的 WordPress 主页和博客
您好,我想创建一个包含更新博客条目的主页。 4 个不同类别的标题列表
我想要一个具有不同模板的常规博客页面的链接。
现在,我刚刚更改了 index.php 以容纳特色帖子内容的容器。
所以这是一个由两部分组成的问题,我如何获得该事物的这些迷你更新 我想多次使用 query_posts() 并按类别分开。
如何创建一个可链接到 blog.php 文件的页面,该文件当前告诉我所有这些函数都未定义。
<?php get_header(); ?>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>
Hello I want to Create a home page that has updating blog entries.
So 4 lists of headlines from different categories
And I want to have a link to the regular blog page with a different template.
Right now I just changed index.php around to have the containers for the featured posts content.
So this is a two part question how do I get these mini updates for the thing
I want to use query_posts() multiple times I assume and separate by category.
And how do I make a linkable page to a blog.php file which currently is telling me that all these functions are undefined.
<?php get_header(); ?>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想创建一个包含主题或博客文件夹之外的 WP 数据/帖子的页面,您需要首先包含并启用 Wordpress 功能:
然后您可以按类别对每组帖子进行查询:
我希望如此有帮助。
If you want to create a page that includes WP data/posts outside the themes or blog folder, you need to include and make available the Wordpress functions first:
And then you can make the queries for each set of posts by category:
I hope it helps.