Multiple custom post types showing up in edit.php

The issue is that pre_get_posts runs on both the Front End and on the Admin Side unless you specifically tell it not to, here’s the function you supplied with a small twist: function pregp_archive_ppp_wpse_108225( $qry ) { if( is_admin() ) { return; } if( $qry->is_main_query() && $qry->is_archive() ) { $qry->set( ‘posts_per_page’, 5 ); $qry->set( ‘post_type’, … Read more

Can’t replace the default sidebar with a custom sidebar on Custom Post Type in Genesis

I have this post and the response from David Chu to thank for enlightening me. There is nothing patently ‘wrong’ with the way that I implemented this. The reason that it doesn’t work is because of the fact that I have both the Genesis Simple Sidebars plugin and the Genesis Woocommerce Connect plugin installed. Both … Read more

Easy reading or transfer of data from posts?

do_shortcode([espro-slider id=21]) will process the shortcode and return the result. The Codex describes exactly this example: // Use shortcode in a PHP file (outside the post editor). echo do_shortcode( ” ); You can often just call the callback directly also: function generic_shortcode_callback($atts,$content) { return “Yay! “.$content; } echo generic_shortcode_callback(”,’ Me!’); VS: function generic_shortcode_callback($atts,$content) { return … Read more

Pagination of custom post type leads to 404 error

Paste this function to your functions.php file if ( ! function_exists( ‘custom_pagination’ ) ) { function custom_pagination( $query_args ) { $big = 999999999; // need an unlikely integer $pages = paginate_links( array( ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) ) ), ‘format’ => ‘?paged=%#%’, ‘current’ => max( 1, get_query_var( ‘paged’ ) ), ‘total’ … Read more