How to display data with pagaination on backend?
How to display data with pagaination on backend?
How to display data with pagaination on backend?
How to add gallery support to a custom post type?
Query posts from multiple post types sorted by overarching menu order
Considering the comments and wasting a few more hours searching for a solution I came to the conclusion I have to review my plugin design. There are two promising approaches: Using a template file and provide a fallback. Providing a “shorttag” generator and make the user to create a post / page for each needed … Read more
This all depends on what you’re actually saving in your post meta. If you’re actually saving the ID you could create a secondary query on your single-post_type.php page. <?php if( have_posts() ) : ?> <?php while( have_posts() ) : the_post(); $cpt2_meta = get_post_meta( $post->ID, ‘_meta_name’, true ); // Get out Post Type 2 Meta ?> … Read more
I solved this problem by putting everything into the init call and then calling a check on the tax.. to see if it was empty. I’m not convinced that this is the most elegant solution or efficient so maybe someone will correct or confirm what I have found as a solution.
You really should try to avoid using query_posts if at all possible. See When to Use WP Query vs Query Posts vs Get Posts Here is a pass through a loop using WP_Query: $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘region’, ‘field’ => ‘id’, ‘terms’ => $region_id ) ) ); $properties = new … Read more
I re-wrote the function, taking a few liberties with it. The main change was specify the ID of the association to link to in your call to get_permalink and to just use $association->ID instead of calling get_the_title (though you could just place the same ID in get the title). I also switched from using the_post() … Read more
How to stop wp_query searching pages as well as the specified CPT
How can I convert custom posts types into regular posts?