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-67a5ae63b540a195419347/] 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-67a5ae63b5662587354645/] or with readmore [crayon-67a5ae63b5665391574962/]
[crayon-67a5ae63b56ff109712785/]