Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”

Try this: <?php get_header(); ?> <div id=”content” class=”clearfix row”> <article id=”post-<?php the_ID(); ?>” <?php post_class(‘clearfix’); ?> role=”article”> <section id=”work” class=”row”> <div class=”span3″> <h3>Recent Work</h3> <p>Intro Lorem ipsum</p> </div> <?php $args = array( ‘post_type’ => ‘portfolio’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 3 ); $query = new WP_Query( $args ); $porfolio_post_ids = array(); if ( $query->have_posts() ) … Read more

How to stick custom post at the top in search results

A simple hack. Edit: putting the featured post ids in an array and checking that array in the main loop. global $post; $post_IDs = array(); foreach($post_info as $post_info_obj) { $post_IDs[] = $post_info_obj->ID; } $featured_IDs = array(); $query1 = new WP_Query(array(‘meta_key’=>’sticky’,’meta_value’=>’featured’,’post__in’=>$post_IDs)); while($query1->have_posts()) { $query1->the_post(); $featured_IDs[] = $post->ID; get_property_info_li($post); } First thing do to in the main … Read more

redirecting improperly after updating custom taxonomy term when referring from CPT edit page

Got it! I’m not sure exactly what the culprit was, but I did a few things that resulted in it working. Here’s a summary of the code I used: I defined this helper function based on code found in redirect_cannonical() function get_current_url() { $current_url = is_ssl() ? ‘https://’ : ‘http://’; $current_url .= $_SERVER[‘HTTP_HOST’]; $current_url .= … Read more

Adding wp_editor to custom metabox

Unfortunately you can’t yet… see this trac ticket: http://core.trac.wordpress.org/ticket/19173 In particular it seems that: The problem is that TinyMCE, once initialized cannot be moved in the DOM, or rather the browsers cannot handle it being moved. That’s why the errors are so inconsistent in different browsers. Moving the postbox triggers this. Some browsers/versions handle that … Read more