Displayling list of Custom Post Type Posts

If ‘Partners’ is a custom post type, then why don’t you use get_posts? Try using it… $pages = get_posts(array(‘post_type’ => ‘partners’, ‘posts_per_page’=> -1, ‘post_status’ => ‘publish’)); echo ‘<select name=”activitymeta_sel” id=”activitymeta_sel”>’; echo ‘<option value=””>Select Partners</option> ‘; foreach ( $pages as $page ) { $option = ‘<option value=”‘ . $page->post_title . ‘”>’; $option .= $page->post_title; $option .= … Read more

Post will not load via ajax

All ajax requests should be routed through the handy /wp-admin/admin-ajax.php file. It works with the great WP hooks system. So you send an “action” with your request and use that as part of the action into which you hook your function. So, let’s say your ajax call looks like this (with jQuery) jQuery(‘a.ajax’).click(function(e){ data = … Read more

Create a list of recent Custom Post Types posts

You can use custom variables ($recentPosts) like this: $recentPosts = new WP_Query(array(‘showposts’ => 9, ‘post_type’ => array(‘mycustomposttype1’, ‘mycustomposttype2′,’mycustomposttype3’))); while( $recentPosts->have_posts() ) : $recentPosts->the_post(); the_title(); endwhile; But if you want to use the loop like normal loop, you need to use $wp_query as the variable. Also, everyone uses the parameters directly to the class as a … Read more