Tag Info

Hot answers tagged

2

Although the new orderby parameter is great in WP_Query, it does not support multiple orderby for multiple meta_key's. I've went through a couple of scenarios and even went and digged into trac and make and came up with the following make.wordpress.org A more powerful orderby in wordpress 4.0 trac ticket #17065 None of the issues regarding this very ...


2

Try $post_ids = wp_list_pluck( $latest->posts, 'ID' ); Read wp_list_pluck


2

Use the fields argument in your query. fields (string) - Which fields to return. All fields are returned by default. There are two other options: - 'ids' - Return an array of post IDs. - 'id=>parent' - Return an associative array [ parent => ID, … ]. http://codex.wordpress.org/Class_Reference/WP_Query#Return_Fields_Parameter $latest = new ...


1

For intensive processes like this, it might be best to schedule a WP cron event to handle the process on a daily or twice daily schedule. Checkout this WP Codex page for the wp_schedule_event() function


1

Try just using the traditional $i iterator (untested) but I can't see why this wouldn't work.. <?php $i = 0; while ( have_posts() ) : the_post(); $i++; if ( $i == 1 ): ?> <!-- First Post --> <div id="post"> <a class="post_image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> ...


1

Well, you need to include the type comparison, or alphanumeric comparison is applied here. In this case, you should add 'type' => 'numeric'. Using Your Class Function <?php public function list_related_docs($id){ $docs_args = array( 'post_type' => 'publication', 'post_status' => ...



Only top voted, non community-wiki answers of a minimum length are eligible