Hi Eshwarspy. I’m trying to get the same to work with my custom post type ‘event’. So to clarify, should your;
add_action( ‘pre_get_posts’, ‘alx_pre_get_posts’, ‘custom post name’ );
instead be:
add_action( ‘pre_get_posts’, ‘alx_pre_get_posts’, ‘my-custom-post-type’ );
or in my case:
add_action( ‘pre_get_posts’, ‘alx_pre_get_posts’, ‘event’ );