简体   繁体   中英

WordPress: Adding home page (=latest posts page) to navigation properly

I have a WordPress template displaying the latest posts on the home page (www.mydomain.bla) as it is the default setting in WordPress:

在此输入图像描述

Now, I want to add a link referring to my home page in my navigation (with Appearance -> Menus). The only way I found to do this is by adding a custom link referring to my domain.

在此输入图像描述

Here's my problem:

Even though the link itself does the job, one thing is not working. When navigating to a single post (like www.mydomain.bla/a-single-post) the needed classes indicating the parent link ( current-post-ancestor current-menu-parent current-post-parent ) do not appear to a custom link like they would to if I had a "Post page" which is not the Homepage.

Is there a way to add a link referring to my posts-showing homepage properly?

Thanks a lot for your help!

Create a new template named "Our blog" and paste the code for posts in this template. Now add a new page named "HOME", select OUR BLOG template and publish the page. Now go to the reading section under the setting tab and change the setting from your latest posts to a single page and select your HOME page. Now you can add page rather than adding a custom link in the menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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