/I have few pages in my wordpress site which should contain some php code. For example news page.
In my front-page.php I have a while which loops trough all posts and prints few news.
In my news site I want to do the same.
I have already tried using
<?php /* Template Name: news */ ?>
But this is only the template, so only my html works here, php while did not output any data.
What is the best approach to achieve this (as simple as possible) ?
EDIT:
In simple words, how to create a static php wordpress page.
Thank you!
get_header
andget_footer
functions. – MahdiY Mar 27 '17 at 20:30WP_Query
or something similar, to grab a group of posts and display them within your news page template. – WebElaine Mar 27 '17 at 20:53