Limit 1 post by user in each custom post type

You’re using wp_count_posts( for counting posts, so it will return the number of posts. If you want to get the number of posts for given user, you should use count_user_posts instead. So change this line: $count_post = wp_count_posts($post_type_name)->publish; to: $count_post = count_user_posts( get_current_user_id(), $post_type_name, true );

Excluded Custom Taxonomy Term Posts Displaying in loop

Try below methods: Try by adding term ID in array like this ‘exclude’=> ’60’ in array If this is not working you can try with below WP_Query loop: $args = array( ‘post_type’ => ‘careers’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘careers_categories’, ‘field’ => ‘term_id’, ‘terms’ => array( 60), ‘operator’ => ‘NOT IN’, … Read more

get taxonomies from terms

After some research I came up with the following // Get the posts in that category with the required tag $args = array( ‘post_type’ => [‘documents’,’news’], ‘fields’ => ‘ids’, // Only get post IDs ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘forms’, ‘field’ => ‘slug’, ‘terms’ => $symbol ) ) ); $posts_array = … Read more

Filter in Custom post type to find the parent post

Let’s if it helps you. Instead of adding a custom query var if we can use directly from url that might solve the issu. First make post_parent loadable from url. function make_post_parent_public_qv() { global $pagenow; if ( is_admin() && $pagenow == ‘edit.php’ ) $GLOBALS[‘wp’]->add_query_var( ‘post_parent’ ); } add_action( ‘init’, ‘make_post_parent_public_qv’ ); Now focus on the … Read more