Because your posts_per_page
has a value of -1 means return all matching query.
You should update your post_per_page
to 1 and specify the order
, and orderby
parameters. Order the posts by date in descending order.
$featured_value_cat_query = new WP_Query( array (
'post_type' => 'values',
'posts_per_page' => 1,
'orderby' => 'date', //
'order' => 'DESC'
...
You can also learn more about the WP_Query Order and OrderBy Parameters
Related Posts:
- WP_Query search posts by custom post type and custom taxonomy
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Different options per post type in WP_Query
- Custom post type and custom taxonomy 404 on page 2
- Foreach loop returning more than one item when querying taxonomy
- set object terms after some some time of published post – functions.php
- Custom Taxonomy – fields
- Values inside a custom field to determine which category posts to display
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- The Operator “NOT IN” Does Not Work In tax_query
- Get custom post type by category in a page template
- How to get_queried_object on multiple objects?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Help with hierarchical custom taxonomies and permalinks…almost there
- How to get only one category of custom post type?
- Custom Taxonomy and tax_query Issue?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- List terms from Custom Taxonomy
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- How to output wordpress custom tags separated by comma?
- Fetch taxonomies by custom post type id array
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Received nothing after executing AJAX post function
- Genesis filterable portfolio isotope [closed]
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom taxonomy rewrite give pagination 404
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- creat filter with wp_query
- Categorize custom post type
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- How to have this permalink structure: post_type/postname/custom_inner_page
- First custom field value (out of several) displayed twice after query
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Get term name without a foreach loop
- How to make WP_Query not to show irrelevant posts?
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query() with custom post type and taxonomy — get all terms?
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Get custom post type categories to show up in menus
- WP_Query parameter conflict
- Show current custom taxonomy
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- List all Custom Post Type posts excluding certain Taxnomy term
- Query custom posts from custom taxonomy
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Related “custom post type” using “custom taxonomy”
- Page that lists publications by classifying them by taxonomy
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- Assigning categories to custom post types via a front-end form; only works for native post type
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- wp_post_delete is deleting all offices
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Live search by custom tag
- Show parent category and subcategory once in while loop
- WP_Query based on ‘s’ and tax_queries
- Ajax load more inside custom post type taxonomy
- How to get the posts that my following users are liked?
- WP Query tax_query not returning posts
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Problems with the WP_Query query for a Custom post type
- Query pulling all taxonomies, not one I am specifying
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Get archive of posts separated by taxonomies and subtaxonomies
- Custom post type and custom taxonomies display
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type
- Custom Taxonomy Query by Taxonomny not working
- Post data in separate divs with incrementing class using WP_Query
- Show Custom Post Type taxonomy term that matches custom field
- Order by custom field attribute
- WP Query Post Type with same Taxonomy name
- WP Query WordPress Post Type with the same Taxonomy name
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Inserting two categories
- display custom post type from register taxonomy
- Store custom post type with JSON content
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Dynamically count the number of custom post types associated to a custom taxonomy