I’ve figured out the answer using the WordPress forum. Solution below:
<?php query_posts( array( 'country' => 'event-england' ) ); ?>
<?php if( is_tax() ) {
global $wp_query;
$term = $wp_query->get_queried_object();
$title = $term->name;
} ?>
<ul>
<span class="tax-title"><?php echo($title); ?></span>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><a href="https://wordpress.stackexchange.com/questions/17046/<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><?php the_excerpt() ?></li>
<?php endwhile; else: ?>
<?php endif; ?>
</ul>
Related Posts:
- Custom post type archive 404’s with paginate_links
- Display Custom Post Type Fields
- Retrieving 3 latest post from each of 5 different custom post types
- how to group custom post type posts by custom taxonomy terms
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- Query not returning CPT posts
- Unable to display multiple post types in same query (WPML WP_Query)
- Query for posts in 2 taxonomies
- Quickest way to get last or oldest post date – WP Query
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Sorting multiple custom post types without a meta key/value pair by sort order
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Get latest 3 posts from multiple CPT in one query
- Polylang non-default language ignores tags in WP_Query
- Different Ways to Query Custom Post Types?
- pagination not working for category.php (custom post types in categories)
- How to display Related Posts based on number of taxonomy terms matched
- How to make WP_Query not to show irrelevant posts?
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- Pagination not working on custom query on a page
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- Custom Post Type Query W/Category Dropdown
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Custom wp-query display post only today
- custom post type and a “sticky” position taxonomy
- Use WP_query to match post types based on custom field values
- minimize wp_query call to database
- Query the title of the page to show posts with matching category in the loop
- Main site single-property.php design, as homepage of a multisite
- Imported Content Doesnt Show Up On Frontend
- WordPress custom post type
- display news with pictures 3 small and one large (loop)
- Custom Query With Multiple Meta Key Value
- Custom post type blog pagination conflict
- Query Posts From Multiple Post Types
- send user to first page of results when reposting to page?
- How do I correctly query posts from a post ID?
- How to exclude certain portfolios from a loop
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Display ACF object field data using Elementor Custom Query
- Assign a tag to custom post type using a query
- Query by post title
- How to get post content by calling ajax?
- Order by & include array by specific post ids
- Number of pages – multiple (custom) post types
- Get latest 4 post on a custom post filtered by category
- Query post types with multiple keys
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Filter posts with meta_query NOT IN where value has multiple values
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Querying Term Posts in Loop
- is_main_query() not working for WP REST API
- Can’t get order_by meta_value_num to work properly
- orderby in custom WP Query does not work
- Unable to retrieve any posts of CPT in wp-admin
- will post_id ever change? Can I safely use post_id for custom queries?
- Including metaboxes from custom post types in global search — continued
- WP Query post__in not returning correct results
- Proper way to display latest 5 posts grouped by post type?
- WP_Query Custom Post Type if Category ID Equals
- Control content before and after custom post type loop
- Select2 AJAX and WP Query Returns ALL and does not filter
- WP_Query orderby not work with meta_key
- Returning a custom content types with meta values
- List categories, subcategories and posts from custom taxonomy and custom post type
- Searching post types
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- wp_query not returning my custom post
- filter the_content, custom post type, and wp_query
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Get next and prev item from custom WP_Query and Custom Post Type
- Query to show post current day
- Using ACF values in nested WP queries for CPT with date values in the past
- Trying to list years (for a filter) but not all years display
- Pagination Not Working When Used With WP_Query() `offset` Property
- Help understand and create a loop with WP_query
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Make pagination work as a carousel (custom query)
- WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category
- Search result based on URL
- update a posts of other custom post type
- New WP_Query not isolating custom post types on front-page template
- Pagination not working on homepage
- How to query custom post then display sections by meta value
- Using tax_query to get single post per category
- Show Posts in Vertical Tabs with Scrollbar