简体   繁体   English

Wordpress-如何使用空白主题将博客模板添加到页面

[英]Wordpress - How to add a blog template to a page using a blank theme

I'm loading a front-end site onto Wordpress using html5 blank child theme. 我正在使用html5空白子主题将前端站点加载到Wordpress上。 The client has asked me to add a blog page to the site. 客户要求我将博客页面添加到该站点。 I've created the page and added it to the header.php. 我已经创建了页面并将其添加到header.php。

I'm not sure why but my page, regardless of whether I update it or not, has this comment showing all the time - 我不确定为什么,但是无论我是否进行更新,我的页面都会一直显示此评论-

博客页面

I'v tried searching on google but I can't find anything to suggest why this comment stays here all the time. 我曾尝试在Google上进行搜索,但找不到任何建议来说明为什么此评论一直都保留在这里。 How do I build the blog template - is there a .php file in the parent theme that I have to replicate? 如何构建博客模板-父主题中是否有需要复制的.php文件? Or do I use a plugin? 还是我使用插件? It doesn't need to be anything more than a bog standard wordpress blog page so they can add some posts from time to time. 它不需要沼泽标准的wordpress博客页面,因此他们可以不时添加一些帖子。

Here's what I have in my header - 这是我标头中的内容-

header.php header.php

<header>
        <nav>
            <a href="<?php the_permalink(4); ?>#particle-slider">Home</a>
            <a href="#what">What we do</a>
            <a href="#who">Who we are</a>
            <a href="#partners">Who we work with</a>
            <a href="#contact">Say hello</a>
            <a href="<?php the_permalink(70); ?>">Blog</a>
        </nav>
    <!-- script type="text/javascript"></script -->
    </header>

I've looked at Appearances>Menu but the menu is not letting me update for some reason. 我查看了外观>菜单,但是由于某种原因,该菜单不允许我进行更新。 Is there a hidden error somewhere I'm missing? 我缺少某处的隐藏错误吗? An assistance appreciated. 协助表示赞赏。

The "You are currently editing the page that shows your latest posts." “您当前正在编辑显示最新帖子的页面。” message comes from having that particular page set as your "Posts page" in the Settings > Reading edit screen. 消息来自在“设置”>“阅读”编辑屏幕中将该特定页面设置为“帖子页面”。

In that case your theme's index.php file will be used for displaying that page (or home.php). 在这种情况下,主题的index.php文件将用于显示该页面(或home.php)。 More on that in the codex. 在法典中对此有更多的了解。 https://codex.wordpress.org/Settings_Reading_Screen https://codex.wordpress.org/Settings_Reading_Screen

And as @shazyriver pointed out you should familiarize yourself with the WordPress Navigation Menus codex https://codex.wordpress.org/Navigation_Menus and the Template Hierarchy. 正如@shazyriver所指出的那样,您应该熟悉WordPress导航菜单Codex https://codex.wordpress.org/Navigation_Menus和模板层次结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM