I have a custom post type (from a theme installed by previous developer), and here is the code of loop which retrieve the post and display them.
<?php // Counter $post_count = 1; // Query $gp_query_args = array( 'post_type' => 'event', //EXCLUDE Events try by me 'post__not_in' => array('1646'), // exclude event try code block ends 'meta_key' => 'gp_event_date', 'meta_value' => date('Y/m/d'), 'meta_compare' => '>=', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => -1 ); $gp_query = NULL; $gp_query = new WP_Query($gp_query_args);
I want to exclude certain events (post of custom post type, from loop), and as you can see i tried using
'post__not_in' => array('1646'), where
1646 is the post id i see when i edit the custom post . So i guess this is universal post id, not custom post type specific id. But No Matter, the post is not being excluded :-(
Am i doing wrong??
I found a [repository on github](links below edit3 ) that is exactly similar to my theme structure. I don't know the theme name, so i'm not sure whether that's the same theme on the site i'm working over.
So as per the suggestions below
I did, renamed template-event.php (my template file for showing list of events ) to
And placed the function snippet from here in function.php of my theme.
But i cannot exclude the post with specified ID yet.
As asked here is the link of the github repository that is exactly same as my theme.