简体   繁体   中英

Styling the wordpress 'Static Blog Page'

I'm having a bit of trouble with Wordpress, I want my blog posts to show on the news page, so I selected that page in the settings tab.

The blog posts show but I want to change the page template, I created a new template which works on all other pages but when I select it from the page template list within the 'news' page it doesn't change but instead just stays the same.

There is no blog.php file, I've even tried changing the standard page.php expecting it to be falling back onto that but it is not! I've tried changing the archives page too but nothing seems to change it!

Any ideas?

It won't be page.php which shows a single page view and you're right, there is no blog.php. Wordpress uses a template hierarchy for displaying lists of blog posts.

As you can see from this diagram - Wordpress template hierarchy

For archives like your News blog page you are looking at category.php, archive.php and then index.php (depending on your theme and which template files you've got).

Rather handily your problem is exactly the same as the working example used as a demonstration in the Codex link I've given above, so this should help explain things more.

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