0
votes
2answers
27 views

Query posts by a type and another type only if post is in specific category

I have a featured post type and a reviews post type. I would like to include reviews of a certain category (I use categories from the posts type) as well. How could query args be crafted? A crude ...
0
votes
0answers
36 views

How can I give Wordpress child custom post type the same title and slug as its parent?

I have two custom post types, one is the child of the other (the parent is more of a modal post). I want the child post to inherit the same title and slug as its parent. I've tried to use the ...
0
votes
0answers
22 views

more tag not recognized but content is truncating

Specifying truncating posts of category 'news' on homepage. Trim works but not recognizing the <!--more--> code in posts... from homepage. code in homepage ...
0
votes
2answers
33 views

How to properly use Categories with Custom Post Types

I'm really struggling with this... I created a few Custom Post Types, let's say... Books CD's Maps Now I also have a whole bunch of existing categories and some of these would apply to more than ...
0
votes
0answers
52 views

Combining / Merging two queries?

So I am working on an isotope filtered portfolio page that pulls any attachment tagged with the term "digital-interactive". Each attachment is also linked to a custom post_type called "work". On one ...
0
votes
1answer
102 views

custom post type upcoming post and past post

I want to retrieve inside my archive-CPT.php most recent upcoming post ( post with status of future) and past post (oldest published post). This is how my archive-CPT.php is looking like: <?php ...
1
vote
1answer
116 views

Wordpress count child posts of each parent custom post type and use in json array for google maps jquery plugin

So i have been looking for a couple of days now and cant find a solution to this anywhere. It is a fairly bespoke request from a client... I am using a jQuery google maps plugin to add markers for ...
0
votes
1answer
93 views

Can't pull posts of a Custom Post Type based on the custom taxonomy of the CPT

My question is about retrieving custom post types via get_posts, when custom post types also have a custom taxonomy. I can use get_posts to retrieve all posts of a custom post type, but when I attempt ...
3
votes
1answer
129 views

Get all authors with at least one post of 'custom post type'

How can i achive that? I found count_user_posts and get_users, but how would I merge them into the desired result? Do I really have to use a WP DB Query?
0
votes
0answers
140 views

get posts with hierarchy and all post meta

I created a custom post type to act as a Family Tree. There are currently 40+ post-meta fields that collect all of the important information. Wordpress's built in "parent" function is used to assign ...
0
votes
3answers
220 views

Get only used meta_values

this is how I'm getting the meta values: $apart_locations = $wpdb->get_col( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = 'postal_location' ORDER BY meta_value ASC" ); This is how ...
0
votes
1answer
151 views

Custom Post Type children and grand-children in one list

So, here is the story: i made a product catalogue with 3 custom post types: - Product - Filegroup (Child of Product) - File (Child of Filegroup) When on product page it should show a ...
0
votes
2answers
59 views

4 posts per page from single category

I've been trying to display posts that I've categorized as "news-categories". My goal is to only display 4 posts on sidebar of "cbs-news" slug underneath "news-categories" category. By below mention ...
0
votes
3answers
263 views

shortcode for recent custom type post

I'm not a coder so I may have done some "coding" crimes, apologies. I've bought a theme who has shortcodes for last posts but not for last "custom post type". So I tried to create last "custom post ...
0
votes
1answer
383 views

Combine query_posts() and get_posts() into single query

I am creating a site which uses normal posts for a blog and the a custom post type for events(generated by the events plugin). I have successfuly used different queries to grab both but I want to ...
2
votes
2answers
835 views

How to get all children and grandchildren of a hierarchical custom post type?

I need to get all sub-posts of a specific (root) parent id. get_posts( array( 'numberposts' => -1, 'post_status' => 'publish', 'post_type' => 'microsite', 'post_parent' => ...
0
votes
1answer
244 views

Query custom posts of logged in user only

I have a custom post type setup called website I thought using the code below would display only the logged in users posts but it's displaying all of the custom posts even those not belonging to the ...
0
votes
1answer
434 views

Get random custom posts from a custom post type

I created a custom post type named predic, I’m trying to get within one of this post other four random posts from the same custom post type. I used this code, but I keep getting the same post I’m in 4 ...
0
votes
1answer
170 views

populate array with posts

I want to generate an array of custom post types to add it to a options array. I'm doing this to show a checkbox group populated with custom post type. I have this array: 'options' => array ( ...
0
votes
2answers
184 views

How to Make infinite loop of post

I am using Post contents as a slider contents, i need to make the post infinite number of loop, ie, If i view the last post after that first post should display and before first post the last post. ...
0
votes
1answer
42 views

How do I display the index position of a post from a custom post type?

So I have a custom post type (ex. songs) and have a few posts that I created for this post type. I want to display them on a webpage in order (ex. 1, 2, 3, ...). How do I get the index position and ...
1
vote
1answer
526 views

Getting a custom post type image using 'get_post_custom'

I am trying to echo the image src of an image I have uploaded for my custom post type outside of the while loop. I have used the following: $custom_fields = get_post_custom($_GET['id']); I can ...
0
votes
1answer
251 views

Display a random customposttype2 excerpt in single-custompostype1.php that shares same taxonomy

OK - Looked everywhere for this one. Details: Custom Post Type #1 = 'product' > registered taxonomy 'productranges' Custom Post Type #2 = 'testimonial' > registered taxonomy 'testimonials' Both ...
0
votes
1answer
2k views

How to query custom post type by term?

This seems trivial but I can't get it to work. Here's my code: $args = array( 'numberposts' => -1, 'eventcategory' => 'nice-events', ...
0
votes
1answer
70 views

get_posts seems to be skipping the last Post

I have custom post type (Events) with 6 events. $posts = get_posts( array('post_type' => 'events') ); echo '<!-- '; print_r($posts); echo ' -->'; This code shows the 5 with the most recent ...
0
votes
1answer
581 views

Getting the list of the latests posts and custom type posts in the homepage

When I need to get a single post type list I usually use get_posts, how can I retrieve multiple custom posts types to populate the site homepage? To be more precise, I would like to get the latest ...
3
votes
3answers
478 views

List most recent image uploads, but only for specific custom post type

I can get a list of the most recent image attachments like so: $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => $number, 'post_mime_type' => ...
0
votes
1answer
870 views

Get the ID of the latest post

Been all over looking for the best way to do this. I want to get the ID of the latest post of a certain post_type. How can I do this in the cheapest way possible (by cheapest I mean using the least ...
1
vote
2answers
1k views

functions.php conditional tag only for custom post type

I'm using gpp slideshow, which overwrites wordpress's default gallery display. I only want to use it on my custom post type, "listings" - how would I reference it to only replace wordpress's default ...
0
votes
1answer
331 views

post__in not taking my list of IDs

I have a Custom Field on a page named banner_id_list. I have a Custom Post Type called top_banner. I add a few banners, note the IDs and then go back to the page and add a comma delimited list of IDs ...
0
votes
1answer
353 views

How to query custom post types with multiple keys?

I recently upgraded WordPress from 3.0.x to 3.1.2. I had set it up to use custom post types before the upgrade. I need make a list of events that are occurring that started in the past until they ...
0
votes
4answers
2k views

Displaying multiple post types on home page

I've read several examples of how to do this but I still can't get it to work - each time I use get_posts() it seems to only keep and display the first set of results. loop.php function ...
0
votes
1answer
92 views

Number of posts in the archive

How do I show 10 posts on the first page of the archive, and 20 on others (>1)? My custom post type name is "apartments". Cheers!
0
votes
2answers
738 views

Conflict between wp_list_pages and get_posts - list pages not displaying

This has only been a problem since I updated to Wordpress 3.1 I have a page that displays a list of custom post types. The page is the child of a parent page. There is a sidebar that lists sibling ...
0
votes
1answer
420 views

Custom query for custom post_type

I need to display a list of current tasks. Each task has a custom post_type and a start date and end date. Can someone tell me how to modify my query so it will pick up any tasks that have a start ...
5
votes
3answers
23k views

Query for custom post type?

I have installed the Custom Post Type UI plugin. After activation of this plugin I have created a custom post type called portfolio. Now I want to use this on the portfolio page in the front-end. How ...
4
votes
2answers
239 views

Show the First Post from Each of 3 Different Post Types on a Web Page?

I have 3 different custom post types: 1.) "events", 2.) "winners" and 3.) "offers". How would I go about retrieving the first (latest) post in each of these post types on a single web page (i.e a home ...
5
votes
3answers
2k views

Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?

(Moderators note: Was originally titled "How to get_posts of a custom post type that is in two custom taxonomies?") I have a custom post type that has two taxonomies which are separate, one called ...