You are missing “foreach” loop. Try this way
$latest_cpt = get_posts("post_type=event");
foreach ( $latest_cpt as $cpt_post ) {
$theidone =$cpt_post->ID;
$this_post_id = $theidone; //get_the_ID();
$key_2_value = get_post_meta( $this_post_id, 'custom_select', true );
if( ! empty( $key_2_value )) {
$thisisworking = $key_2_value ;
;}
echo $thisisworking; }
Related Posts:
- get_field not displaying my custom field value
- Get the children of the parent category
- How to check if I’m on the last page of posts?
- How do I get the category URL from get_the_category?
- Default WP Gallery – show only galleries of a certain category
- Display all posts in category, with specific tag posts at top
- Loop with Dynamic Categories
- adding custom fields to next and previous post link
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- How to exclude categories from recent posts, recent comments & category widgets?
- Listing all posts from current category on page
- Return category slug / title from category ID
- Filter out posts before display category count
- How to put enctype=”multipart/form-data” in categories form?
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Add custom taxonomy under the category title
- Why would in_category only return one post in a specific category?
- Class active for Archive link – looped out
- need to add custom field in more products
- Taxonomy name repeating when showing 2 posts from each category
- How to change a post category when the ACF datepicker Field is today
- Display the last post by each category?
- Counter in loop in foreach
- Listing Texts of Which Custom Field is Null
- Multiple Loops on category.php with pagination on last loop
- How to exclude the last post from a category(featured for example) from the main loop?
- Order by category titles
- ajax for filtering posts by category in wordpress loops
- How to query categories with Advanced Custom Fields?
- Limit get_categories to show each category once
- How to add custom color fields to the category edit page?
- Display single category name in woocommerce loop
- Show Posts from Single Category Not Working
- Notice: Trying to get property of non-object in : custom fields category
- Is there a reason I cannot get the current category in a loop?
- Category archive is displaying all posts rather than the specific category
- new WP_Query all post in a category inside the loop
- Problem with different query loops (and “main loop”) on category template page!
- How to add orderby parameter for sorting on category.php
- echo get_post_meta of all post in a category to fill up a select field
- How to loop custom post_type from (a) specific category(ies)?
- How to display the parent category if only the child category has been chosen
- Category tags with comma’s
- Display posts of certain categories to specific user roles
- Remove any product that is featured from regular display loop [WooCommerce]
- More efficient way to list posts by category [duplicate]
- Category nicename inside loop in wordpress
- filter a loop base on specific category
- Problem with multiple loops in wordpress theme
- Displaying a custom field in Category Archives
- List post only under the category, exclude child category content
- Editing Loop So It Targets Specific Tags?
- Problem: retrieving parent category’s first post
- Custom Fields Value As Taxonomy
- Update custom category fields front-end
- How to get posts using category slug in ClassiPress?
- What is the best way to add an advanced / intermediate / beginner tag to a post
- Posts made to category don’t show up (do show up on frontpage)
- Adding tinymce to Custom Field boxes on Category edit page
- Category post count is not correct
- Display all categories but only if they have posts in them that have a specific tag assigned
- Include last post date in get_categories loop
- Sort categories by custom field in WordPress admin
- How to get specific (grand parent) category of current post?
- how tho change number of posts in loop from specific categories
- Modifying category order
- error in specific category loop
- loop in single.php of the same category
- How can I add different custom fields for each category in the same post?
- Please tell how to stop the category from showing up on posts
- Hide a category/posts from the homepage in wp
- How to modify custom category field from front end?
- Loop by category and meta_key
- Ajax Category add doesn’t update the list table custom column
- Assign a class to first element in category in loop
- Trying to display all posts in a category
- Category page shows only 1 post when that post has more than 1 category?
- Configure query with multiple categories in a custom order?
- How can I modify this code to iterate over an array of categories?
- Loop within category’s posts
- How to exclude a specific categogy from a custom page template
- Display one post on category.php: Wrong featured image
- $args Orderby The number
- ACF plugin categories bug in WordPress 3.9
- WordPress Numeric Pagination with Query String [duplicate]
- Several loop in search result
- Printing direct descendants of a category with WP_Query
- My Query is getting the wrong data
- Formating content in category.php
- Sort categories by meta value
- How do i add custom post types to this query?
- Custom WordPress category page showing all posts rather than the specified category
- How do I hide posts in a category from all listings but still allow the posts to be viewed?
- Do not show all post from all categories, just show posts from category in current loop
- Echo Category In Loop
- How can I implement pagination on custom category page?
- Get categories by title descendant