I made it through! I’ll share how I did in case some other person lacking the php knowledge like me lands in the same spot.
add_action('elementor_pro/posts/query/projects_designs_query', function($query)
{
$post_id = get_the_ID();
$meta_query[] = [
'post_type' => 'designs',
'taxonomy' => 'projects',
'value' => $post_id,
'compare' => 'in',
];
$query->set( 'meta_query', $meta_query );
} );
What this achieves is firstly getting the ID of the current post in the loop (which in my case is a Project custom post type). Then it gets all the post (with custom post type Design) that belong to the same project (the current post).
Related Posts:
- How to filter out post type meta?
- creat filter with wp_query
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- Saving Taxonomy Terms
- How can I remove the “Add New” button in my custom post type?
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- How to get a list of term names of the custom post type im currently on in single.php
- Ajax filter with custom taxonomies
- Query multiple taxonomy in Custom Post Type
- Filter posts with ajax form and checkboxes
- Get the most popular terms for a custom post type
- WP insert post PHP function dynamically generated Custom Fields
- Adding posts of custom type into the main feed
- Inserting data into `post meta` table?
- Get all taxonomies for all post types
- WP_Query search posts by custom post type and custom taxonomy
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Conditional to modify query results
- Modifying date filter on admin page for custom post type to link to custom field
- Get Post Primary Category
- Custom Post type is being ignored in query
- Order By Post Type ThenBy Taxonomy
- Categories of custom taxonomy don’t show any posts
- How to Filter custom post type by taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- search suggest – filter post type
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- How to organise this data within WordPress
- Different Category system needed for the Custom Post Type
- Redirect to another page using contact form 7? [closed]
- How do I add custom HTML to the content of an archive page’s posts?
- Pagination hitting 404 page on /page/4
- Query custom post types & Taxonomies and list them in a table on a page
- Querying a custom post type, but not show duplicates
- Shortcode to return single custom post based on post taxonomy
- How do I get the index for a custom post?
- Custom taxonomy query showing more than 4 posts
- Using page title as a link to term archive
- How to get post count of specific taxonomy that have store name & category
- Page that lists publications by classifying them by taxonomy
- Query filter by value in meta_value array
- Filter taxonomy by CPT
- Check that a slug is present in the get_terms request
- Display category filters for custom post type when category is shared by multiple post types
- Dynamic page for nav items used as filters
- Custom post type order by post_title
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Taxonomies are not showing in the category dropdown
- Taxonomy doesn’t follow slug permalink structure
- Custom Taxonomy – fields
- tax_query not working?
- Sorting on Taxonomy in archive page
- Custom Search not working
- Exclude Custom Post Type from shared Custom Taxonomy
- using ACF datepicker to filter posts on a page
- Looping taxonomy in taxonomy?
- Code in custom widget queries all posts, when it should only query the current post
- Order custom post type is beign ignored
- How do I filter a custom post type loop by a field?
- Custom Filtering date with newsletter
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- Disable WordPress Recognizing Path as Attachment
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- How to get Custom Post ID by adding filter to child theme’s function
- How to check if “is single” page
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Get custom post type list for every category shortcode
- Filtering WP_Query
- How do i calculate the total of values of custom fields in custom post types?
- Custom post type – get_day_link()
- Meta query for custom post type ignored in main query
- Custom post taxonomies as tax_query terms?
- Get related posts of child term of custom post type
- Filter term taxonomy metabox in custom post type
- Use custom metabox to update automatically a post after a given date
- Loop filtering Custom Post Types and/or Categories
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- How to define a term for custom taxonomy
- Make (custom) post type accessible only by custom query
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Removing full title and breadcrumb header container for a specific post type
- Using Pagination for Custom Post Type and keeps returning 404
- Validate Custom Post Type fields
- Creating custom post type posts and associating them with a post from another custom post type
- meta query not retrieving posts
- CPT Repeatable Fields + Undefined Index
- redirect after submiting post for review
- Get only parent post in archive post
- Custom permalink structure for custom post types including multiple taxonomy
- Filter posts by their related field’s custom field
- Help Adding filter to Add Media button for custom post type
- Include images from pages in wp search.php results in default wp search
- I want to create an archive and single page for a custom taxonomy for a custom post type
- WordPress loop add heading before first of type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Custom Post-type not returning the right child_of
- Pagination not working with custom loop
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Custom post type is_singular condtional not working when managing sidebar display