Linking Two Post Types

Scribu’s posts-to-posts is a great and simple plugin, I’m sure we can help you get it working. The basic usage is pretty straightforward. assuming your custom post types are named ‘place’ and ‘event’, the following code would go into your theme’s functions.php file: function my_connection_types() { p2p_register_connection_type( array( ‘name’ => ‘events_to_places’, ‘from’ => ‘event’, ‘to’ … Read more

Filter next_post_link() and previous_post_link() by meta_key?

I managed to get this working using nothing but WordPress filters, thanks to @Milo’s hint. Just note that these are pretty specific to my case but you shouldn’t have a problem modifying them for your own use. I am using Advanced Custom Fields with a Date Picker field called date and Prev/Next links only point … Read more

Custom Loop for Custom Post Type

There are couple of issues in your query. There is not parameter named category. You can use these following. cat (int) – use category id. category_name (string) – use category slug (NOT name). category__and (array) – use category id. category__in (array) – use category id. category__not_in (array) – use category id. If you need your … Read more

Get list of registered custom post types

Your code looks good. However, you can try the followoing codes to get all custom posts $args = array( ‘public’ => true, ‘_builtin’ => false, ); $output=”names”; // names or objects, note names is the default $operator=”and”; // ‘and’ or ‘or’ $post_types = get_post_types( $args, $output, $operator ); foreach ( $post_types as $post_type ) { … Read more