Here is an idea. Note, this will only work if all posts are in the desired category and if all posts have only category
The posts are returned in an array which you can access through
$currentissue->posts
With this in mind, you can get the first post ID as follows
$currentissue->posts[0]->ID
Now, you can add that to a variable
$id = $currentissue->posts[0]->ID
You can now use get_the_category
to retrieve the category this post belongs to. Remember, this will be the category that all posts belongs to according to your question
Something like this would work just ouside your loop, just inside your if
statement
$category = get_the_category( $id );
echo $category[0]->cat_name;
Related Posts:
- Inject post (from specific category) between posts in Loop
- retrieve thumbnail from post ID of best selling product in category
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- How to hide posts of a specific custom category in WordPress?
- Post not populating for custom post type based on category selection
- Do not duplicate posts with multiple categories in multiple loops
- Using multiple variables to assign categories to an array
- Query seems to be duplicated
- Fix incorrect related posts code snippet
- Display all categories (with link) of custom post type – WordPress
- How to filter posts by post format “standard” from wp-json api?
- Why is variable not working on custom sql query using wpdb?
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Can’t search posts using WP_QUERY inside AJAX Function
- How to query for pages/post depending on slug?
- How can I use wp_query to show all product data using just the products ID?
- hover image appears below placeholder instead of overlayed
- combine Code 1 with Code 2
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- get current product name in functions.php
- Random order of WP_Query results with highest meta value
- Custom page archive query by url var calling page twice on one of my custom queries?
- WordPress custom slug (endpoint) and compare all links
- get post based on category chosen in drop down – The ajax method
- How to use transient in this code for related post?
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- get current custom post ID by WP_Query method
- Creating a related post section based on similar categories
- Swapping wp_dropdown_categories function with wp_category_checklist
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Using foreach loop breaks
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP Query with custom Shortcode
- wp_query with cat not working
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- How to use an associative array in post__in with WP_Query?
- Proper syntax or method for keeping url in modified isotope / category links
- Filter Select results based on selection
- If Query In Sidebar
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Compare post-IDs within WP_Query? (Less than / Greater than)
- What is an equivalent of single_cat_title for getting the slug of the category?
- Issue adding sub category programmatically
- How to use $query->set with post__in?
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- how do I get a specific post from a post with a subcategory in WP
- WP grandchild categories in nested ul li
- Grab posts by multiple categories
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- How to show single category archive
- Dynamic content based on a URL parameter
- Move category description below post list in blog
- Display a specific category of products in shop page and disable code for specific actions
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- How to pick the default selected value in wordpress dropdown?
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get page that displays all children of taxonomy parent
- Add more button if more 8 items
- How to store post ID’s in cookie or session to display the same posts later
- WordPress, AJAX and pre_get_posts using conditional tags
- selected option if current category is the value
- Get users that likes the post
- get_template_part based upon post’s category
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Exclude posts based on meta value
- how to save selected option in variable for rest api category filter
- Setting default category base on theme activation
- Hide subcategories (widget)
- Alert Bar section within WP loop is displaying even though there are no posts
- Let Users Choose Post Categories
- Custom query, checking values of multiple meta keys
- Different post styles depending on category
- Display category name only once inside loop
- auto-populating custom nav with all items from custom post type
- inserting a post from an extern php file but post content doesn’t show on wp site
- Remove echo from shortcode
- How to show only subcategories in parent category not parent category?
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- WordPress theme options error
- how to show only specific category for a template
- Redirect to another page using contact form 7? [closed]
- Security for data obtained from the database
- Fatal error: Call to a member function query() on a non-object
- Dilemma of Populating all the categories in a drop down list
- Get posts from multiple post type
- Display most popular posts of category
- Is it possible to retrieve all posts with a certain value for metadata?
- How to get all author posts outside of author templates
- WP_Query fails despite having 1 post
- Creating sub-categories via php
- Create a Blog Template Page
- Define specific category name in PHP
- Edit the_category (); for a hierarchical display
- JSON REST API WordPress only showing first 10 categories
- Category title output before opening title tag