Custom Post Type + ACF and performance [closed]
Custom Post Type + ACF and performance [closed]
Custom Post Type + ACF and performance [closed]
The following is an example of how you could achieve this (I am assuming the_field is a result of Advanced Custom Fields)… Please note that it is incredibly inefficient, there are other ways to do this that may improve performance and reduce the need for repetitive code. <?php $query = new WP_Query( array( ‘post_type’ => … Read more
function custom_post_type() { custom postcode here } add Action hook at the end of functions add_action( ‘init’, ‘custom_post_type’, 0 );
The $post you’re working with is a WP_Post Object and you must interact with it as so. $post->post_status=”draft”; It’s usually not a good practice to modify the $post object directly so it’s something you may want to avoid. A better way may be to simply pass an array of values to wp_update_post() function like so: … Read more
You are missing <?php endwhile; ?> before the end of content div. get_header(); $args = array(‘post_type’ => array(‘post’,’media-appearance’,’members-archive’,’money-saving-tips’,’review’), ‘posts_per_page’ => ’20’, ); $this_query = new WP_Query( $args ); ?> <div id=”primary” class=”site-content”> <div id=”content” role=”main”> <?php while ( $this_query->have_posts()) : $this_query->the_post(); {?> <?php if( has_post_thumbnail() && ($cat == ‘budget’) ): ?> <div class=”tip-excerpt”> <h1 class=”entry-title”> … Read more
I have this running on my sites as you describe, but I use a plugin for it called Admin Columns. I think their integration with ACF is part of the paid “pro” version, though.
You’ve got the unnecessary array involved around clauses. The correct code is ‘meta_query’ => array( ‘relation’ => ‘AND’, ‘awards_clause’ => array( // clause ‘key’ => ‘awards’, ‘compare’ => ‘EXISTS’, ), ‘points_clause’ => array( // clause ‘key’ => ‘points’, ‘compare’ => ‘EXISTS’, ), ), ‘orderby’ => array( ‘awards_clause’ => ‘DESC’, ‘points_clause’ => ‘DESC’, ),
custom post type WYSIWG removes paragraphs when displayed
Custom post type + category archive page
Action or Filter Hook for a Custom Importer