You don’t have a meta_value in your query.
From your code I can’t tell what you’re doing with the meta values but you should be able to do this:
// Store this BEFORE you go into the second loop.
$category = get_field('category');
// The arguments for the second loop
'post_type' => 'case-studies',
'showposts' => 3,
'meta_key' => 'category',
'meta_value' => $category,
'orderby' => 'rand'
So what you’re doing there is matching the value of the category meta key.
Ideally you would be using a taxonomy to do the above – that’s what they are there for.
http://codex.wordpress.org/Function_Reference/register_taxonomy
Related Posts:
- how do i remove posts from a WP_Query so the pagination is right?
- Redirect to another page using contact form 7? [closed]
- Price comparison table based on Custom Post Type?
- WordPress hide post from custom post-type on a single page
- Manually set global $post vars with an ID, in order to use template tags
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Template for custom post type shows all posts instead of just one
- Fastest way to loop through all posts?
- Enable comments for post with comments meta box removed
- Custom Post Type causes Page Not Found
- post expire after x days
- add_meta_box Callback not being called
- Plugin allowing for artists, events and venues
- Is there a way to order posts and custom post types as one group?
- Saving Custom Post types and fields to a custom table
- Accessing post’s meta data based on user’s click of a post
- get_post_type on post.php
- Matching Chapters to a Custom posts [closed]
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- auto populate list of questions if user select a category xyz
- Custom Post Type Fields
- How to delete all trashed item in one-go
- Custom setup of wordpress comments that are displayed
- Recent posts per category loop?
- Import Instagram post to WordPress blog post
- How to Resize the Custom Post Images?
- Amazon.com intergration with WordPress?
- Sticky option for custom post types without using custom fields or plugins
- posts from multiple post types in one slider
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Modify Posts from Custom_Post_Type within the plugin
- How can I store data from custom fields to custom tables?
- Custom Template for wordpress cpt plugin
- What hook can I use to modify custom post data before it is displayed on the page?
- Plugin is creating posts twice
- “After file loaded” action
- Dictionary-style definition list plugin
- How to create repeater field manually, without plugin (ACF Pro)?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Is it possible to pin a post in second position from top
- Register PODS Custom Field with WPGraphQL [closed]
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Adding custom post category to categories widget
- How to display the custom post related blog by category?
- Create multiple posts when a custom post is created
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- How to Save settings of custom tab product page in admin side in a database?
- Add new post using a page inside the website
- Displaying image from a repeatable group
- WordPress list child pages of custom post type
- What method should I use for a sidebar widget that reads latest posts?
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Insert data in custom table during new post creation
- single.php fires more than once after clicking on any post to view with different post id each time
- How can i do custom author list?
- A plugin for software reviews site like this one?
- Outputting custom field query from a plugin to the website header
- Links not opening as they should. Custom WP plugin
- Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
- How to export post tags from wordpress
- What is the easiest way to create a custom field archive?
- how to compare date meta value in jet smart filter Date query?
- Disable All In One SEO plugin for custom post type
- How to check if the post exists in any of the categories?
- Internationalization of Blog Posts
- Turn post into simple slideshow
- Issues with Post 2 Post Plugin
- Create custom fields on a post
- Find And Add Category to Posts
- Retrieve post thumbnails
- Custom Post type plugin breaking the front page shows dashboard?
- WordPress Meta Query: Relation is not working correctly
- WordPress ultra slow if I click on posts?
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- How to add character to content of post?
- Get page type to display content
- get_option include in my adsense
- WordPress Custom post type won’t save properly
- Capturing POST data
- Pulling in a particular post into a single page based on the post id passed into the code
- Top Contributors Plugin with Custom Post Type
- force category table refresh when adding new category
- Styling first post using Advanced Custom Fields
- loop through custom post-type with two meta_keys
- Is there a way to add a custom input field for every taxonomy term in WP post editor?
- Making a Custom Post Type Publish Loop
- Extending a CPT by Created by another plugin
- featured image problem with custom post type
- Twitter List Tweets and Delicious Links as Posts
- Most visited posts
- How do i use postMash to order posts in a custom loop?
- Get a submitted value from front end post form for single template
- Using Postmash plugin in WordPress 3.3.1
- Advanced Custom Fields Plugin – not displaying images
- How can I default a new post to being saved?
- What is the correct method for updating post content from a plugin?
- Custom feed parameters / Template overriding
- WordPress User Frontend Editing Custom Fields