Two Custom Post Types Many to Many Relationship
Two Custom Post Types Many to Many Relationship
Two Custom Post Types Many to Many Relationship
Use something like this after you foreach loop. In this example link is saved in new meta field. You can overwrite document_overview_document-link, but then you will get combined html code as link value when open your document in editor. foreach { … } if ( isset( $_POST[ ‘document-link’ ] ) ) { $html=”<a class=”btn btn-outline-info … Read more
Get related posts of child term of custom post type
You have to create a custom taxonomy: add_action( ‘init’, function(){ register_taxonomy( ‘program’, ‘your_post_type’, array() ); }); To get users associated with a program, get all posts that have your desired program term: $query = new WP_Query( array( ‘post_type’ => ‘your_post_type’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘program’, ‘field’ => ‘name’, ‘terms’ => ‘your_program_name’, ), ), … Read more
Hide post navigation if current post is in a category with only one post
How to automatically set ‘default image size’ for specific Custom Post Type
There is an example of how to do this on the official doc for WP_Query: https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters Specifically, by declaring multiple items in the tax_query and setting their relation: Display posts that are in the quotes category OR have the quote post format: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( … Read more
Since jet engine works on Elementor, you can add a custom query filter This may sound a bit complex, but it can work for your case. Add a hook that on save post will create a array of articles and ads in the order you want. Store the post Ids in a transient. In the … Read more
Custom Path/Folder behind a custom post type
If anyone is interested in how to achieve the result for the question I posted, I managed to work it out! As the correct results we’re being displayed, but for each iteration of the foreach loop rather than the specific day, I managed to get the results to display/hide by using if (is_object_in_term($class->ID, ‘calendar-day’, ‘monday’) … Read more