April 24, 2024

MoDCore

Welcome to the core

WordPress – How to Make WordPress Pages Act and Look Like Posts

1 min read

How to Make WordPress Pages Act and Look Like Posts

Getting Pages to Appear on the Homepage

If you’d pages to show like posts on your front page, then go to your theme’s functions file, and insert the following code. Found this within the control panel of the site and couldn’t seem to access via the wordpress settings of the page!

Make sure you save a copy of the functions.php file before making any amends to be on the safe side!

add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( is_home() && false == $query->query_vars['suppress_filters'] ) $query->set( 'post_type', array( 'post', 'page') ); return $query; }

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © All rights reserved. | Newsphere by AF themes.