Adding or Including custom post type to default WordPress loop by altering the ‘pre_get_posts’ function. Here it use add_action() function. This will help to display those posts (custom posts) alongside the default posts in the regular post feed.
Add this in you functions.php file
function add_custom_post_type_to_query( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
// if ( is_home() ) { // Use this if its not for main query
$query->set( 'post_type', array('post', '2nd-post-type', '3rd-post-type') );
}
}
add_action( 'pre_get_posts', 'add_custom_post_type_to_query' );
Limit the number of posts revisions that WordPress stores in the database. edit wp-config.php file…
In Multisite, List Recent Posts Across an Entire Network by using custom query or WP_Query…
code for the plugin file itself:- [crayon-692e1c773dccd349156870/] I like to put this in the actual…
Switching the permalink structure from /year/month/post-slug to just /post-slug is easy by going to Settings…
[crayon-692e1c773df4a709015901/] or with readmore [crayon-692e1c773df4f656680280/]
[crayon-692e1c773e042302139907/]