If News is a category of posts, then:
- First, find out the category ID, login to wp-admin, go Posts->Categories, mouse over the ‘News’ category, and cat id should be shown under the left corner of the browser (for chrome this works, not sure about other browsers).
-
Add the following code into your function.php
function my_news_category( $query ) { if ( $query->is_frontpage() && $query->is_main_query() ) { $query->set( 'cat', '18'); //remember change this to the actual cat id } } add_action( 'pre_get_posts', 'my_news_category' );
For this solution, you don’t have to change the underscore template at all.
Alternate solution would be adding query_posts() before displaying the main loop on your frontage template as I suggested on my comment. See official documentation for more details on how to implement it.
Related Posts:
- How to get posts published between a date and today?
- Display all posts from specific categories on a page
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- Why do I need to use The Loop on pages (inside page.php etc)?
- posts page – different lengths of excerpt
- Can’t show comments count per post outside loop
- Multiple loops in same page, without duplicate content
- How to Display Post View Count
- How would I get 1 latest post from a query for 5 posts?
- Differentiate between posts and pages in search results
- page.php showing loop of posts and not page content
- Inserting custom data to the_post() during loop
- How To Get Posts With A Specific Word
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Multiple loops are not reset
- Display all posts that were published before full post on single.php
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- How to order posts in an arbitrary order?
- Wrong post title displayed from loop
- Multiple Loops Breaking Pages
- Get the amount of posts on a current page
- How to get posts published on the latest date?
- How to only publish posts with image in it
- WordPress Query Posts From Category Post on Static Page
- WP_Query: Show 10 posts in date order, first three random
- Display specific posts on home page
- Display 3 posts with different HTML markup using a loop
- Pagination for normal (standard) posts on a page with a custom loop?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- posts going to 2 pages/categories only show up in 1
- How to show post views shortcode data for each post on Posts List Page?
- How to distinguish pages created by woocommerce?
- Use special template for the first post in the loop
- Posts are not showing up on next page.
- Modify WordPress loop after it has been run
- show latest authors blog post
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Adding a category at even positions on main loop with modified pagination
- How to inject a post within a loop
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- The loop: more posts than I want to fit on one page
- Redirecting posts in WordPress to a specific page
- When and how will php code in a user made WordPress page be executed?
- What function does the loop of displaying posts?
- Why does ‘get_the_ID’ work outside of the loop?
- Get the Current Page Number
- Keep featured content post in homepage with original order
- Stop WP from creating “Sample Page” and “Hello World!” post
- How to display by default only published posts/pages in the admin area?
- How set featured posts using checkbox in post edit screen?
- WP_Query: Why is sticky post not first item in loop?
- Display posts by tag on page
- how to display full post with pagination on home page
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Can I change a post to a page by changing it’s type?
- How to use alternate post layout at key points in post loop?
- Add a custom option to a page in backend
- Order post by year DESC and month ASC
- Showing random content / pictures from earlier posts in a sticky post?
- Creating new page with pre-defined parent page
- Populating a page with content from post custom fields
- Function to show random posts from a category
- Double count view in archive.php
- disable column on post and user list
- Can a page_id and a post_id be same?
- How can I display widget in a Page or Post?
- Different style for most recent article
- Getting a 404 error when clicking edit page
- Loop through all product posts?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Display post category in foreach loop with category link
- Displaying Latest Posts on a Page
- How to make multiple sections in home pulling posts category wise?
- Proper way of establishing custom landing pages in WordPress
- Archive template combined with post slider and regular posts
- Bootsrap carousel for post
- List all posts, pages and custom post types in admin
- linking to post outside the loop
- Trying to query all posts in category 4
- Create a frontpage.php and static page template
- Determine if ID is page or post and query the ID
- How to show next/prev link, when it’s not active?
- Defining ‘last’ class on foreach blog posts
- Can I restore restore content from old Worpress site to a new Worpress site from an archive
- Want to change the post every three days with in specific category
- Displaying all posts from other sites on the network on one site
- Display all tags even if they are not assigned to a post
- How can I get the last post while on the first post for pagination? As if it were infinite
- Posts on Sidebar only
- Hide Admin posts & pages in Dashboard
- structure of posts and pages
- Call posts of particular category in a page
- Advanced Post Display/Pagination/Ordering
- Add wp-link-pages to post
- Woocommerce – custom post type of checkout page
- How do I create a template page to show 3 blog posts?
- blog post displaying within older post – loop issue?