Custom Post Types extend the WordPress back-end to support additional, non-Post content.

learn more… | top users | synonyms (1)

4
votes
4answers
5k views

Fail to compare dates in meta_query

This is the piece of code I use to get event posts whom date metadata is newer than today : <?php query_posts( array( 'post_type' => 'concerts', 'meta_key' => ...
4
votes
2answers
2k views

Custom Post Type Plugin: Where Do I Put The Template?

I'm writing a custom post type plugin. Part of it I'm outputting to the template via shortcodes. But other parts need a custom post template, and I figured out how to use the template hierarchy for ...
4
votes
3answers
6k views

Hook for post and page load

I need to run a function when a particular post or page is loaded. Is there any hook that lets me check whether a post is being displayed during page load ?
4
votes
3answers
2k views

How do I change the author of a custom post type?

I have made a custom post type and need to be able to create posts and assign them to authors. It is easy to do this with posts as you can go to the bulk edit screen and immediately change the author. ...
4
votes
3answers
621 views

Post formats “audio” and “video” only showing in index.php

I have files in my theme called single-audio.php and single video.php, but when I click on an audio post-format or video post-format wordpress uses the index.php instead of my single-audio.php or ...
4
votes
5answers
7k views

How do I get the permalink of a custom post type?

I can get the permalink of a specific post tag or category, but what if I want to get the permalink of a custom post type? I can't find anything in the Codex or anywhere else about how to do this.
4
votes
4answers
3k views

meta_query for keys that aren't yet set

I'm trying to query for a custom post type for a gallery system. I have a checkbox to set a gallery as a "featured" gallery (set up through More Fields plugin) - if this is checked then the meta value ...
4
votes
1answer
3k views

Search multiple custom fields by using meta_query

I'm trying to create a search results listing for a custom post type and the problem I'm running in to is with the way the 'meta_query' parameter is stringing the passed values together. It appears ...
4
votes
4answers
3k views

Front end registration/login & publish/update 1 custom post

I want to be able to allow a user to register/login via a front end form and be able to create 1 custom post which only they will be able to edit and update via a front end form. This will be part of ...
4
votes
1answer
4k views

why doesn't the_content() work in this {single-custom_post_type.php} page?

This code is from my page single-publication.php. It outputs the relevant custom fields etc (here wrapped in template tags), but the_content() won't output the post content. I've resorted to using ...
4
votes
2answers
12k views

Can I assign a template to a custom post type?

can I assign a template file to custom post types? I have created a custom post type called items, and I would like to assign templates to the items like you can do with pages.
4
votes
2answers
1k views

Possible to change the URL for the regular post type without affecting the URL of other custom post types?

The Dilemma I have a few custom post types: Portfolio Items Testimonials FAQs The URL structures for these custom post types are: mysite.com/portfolio/name-of-custom-post ...
4
votes
1answer
369 views

Can I make user role that can only access a certian content type?

I would like make a custom role that can only access a custom content type that I'm going to be creating in the admin. Is that possible and does any know of any examples or tutorias that I should ...
4
votes
2answers
50 views

Admin Filter - Add Post Type Description on Post Type Page

WordPress allows adding descriptions to Custom Post Types whenever it's registered. ( register_post_type(). I would like to output that title on the Admin Landing Page ( View All Post Type ) ...
4
votes
3answers
1k views

Setting a custom sub-path for blog without using pages?

Warning: fairly pedantic request ahead. I have a design that makes use of posts (I.e., the blog) and a custom post type called "howto". The site front page ("/") has a template that displays the ...
4
votes
5answers
3k views

the_author_posts_link() for authors of custom post types

I have both regular blog posts and a custom post type in a blog. The page template shows the author posts link. If you click on that link for an author that has authored some posts, that page ...
4
votes
2answers
902 views

Why does my custom WP role need edit_posts to edit images?

This may be obvious to someone other than myself. I think I remember reading somewhere that an "image" is indeed a form of "post". I have a custom post type called "listing" I have a custom WP role ...
4
votes
2answers
5k views

Custom Post Type Archive Page: Set Posts Per Page, Paginate

I have a custom post type called video. Would like to paginate its archive page, showing only 3 posts on each page. There is also a custom loop on the archive page that outputs all the video posts ...
4
votes
3answers
972 views

Custom Post Types 404 Issue

I dont know why my custom post types render the Page not found. This is the code I am using to register custom posts. www.example.com/products/product1/ renders 404 where as ...
4
votes
1answer
2k views

How to order adjacent posts (prev / next) by custom field value?

I am using the More Fields and More Types plugins to create a custom post type called product. This custom type is based on the Post type. One of the fields is named lot which is an integer ...
4
votes
1answer
75 views

get_the_ID() is working on my local development but not on staging server

Great to see a StackExchange for WP! Ok so I'm working on pulling images and dates from piklist custom post types and I got this working on my local, BUT when I move it to WPEngine I get a white page ...
4
votes
1answer
157 views

How to show Y number of custom posts after every X normal posts?

I have a loop within a loop. I figured out how to show all or X number of custom posts after Y number of normal posts. I also figured out how to show 1 custom post after every Y normal posts. How do I ...
4
votes
1answer
1k views

Filter custom post types in admin not working

Hello I'm wondering if anyone can help me figure this out. Essentially when I click on my custom post type 'Portfolio' in admin, I see a list of 'Services' next to posts, but when I click on one to ...
4
votes
2answers
2k views

How do i display the post type title?

Hi i was wondering if there is a way that i can display the custom post type title. For example: I have a custom post type entitled "Pretty Little Liars" and it also shows on the homepage, but how ...
4
votes
2answers
509 views

Returning search results by relevance, including Custom Post Types

The default WordPress search setup isn't really working for my website's setup. I have two custom post types (species, glossary) which I'd like to search for, as well as the standard post type. The ...
4
votes
1answer
511 views

Two Custom Post Types, Share Two Taxonomies

I have two custom post types Hotels Things to do And I have two taxonomies Activities Regions So when a user sees a Hotel (custom post): the user can then see the region it's in what ...
4
votes
1answer
3k views

Custom sortable columns ordered by meta-value?

I have no idea why my sortable function does not sort my "events" my a custom post-meta. I have a custom-post-type named wr_event… I have my custom columns set up and my post-meta is shown in the ...
4
votes
5answers
3k views

Remove slug in taxonomy url

Just wondering, how can remove slugs from some URLS. I'm using a custom post type called exhibitors, and some taxonomies to define those exhibitors (eg: featured-guests, publishers etc.): Right now ...
4
votes
2answers
4k views

Adding post tags to custom post types

Standard WordPress post types have "Post Tags" which can be used to "tag" posts with similar content, makes those similar posts easily accessible just by opening that particular tag page and receiving ...
4
votes
2answers
1k views

Page as child in custom post type slug?

I have the following structure: /projects (archive of cpt projects with template archive-projects.php) /projects/project-1 (single view of cpt with template single-projects.php) /projects/downloads ...
4
votes
1answer
4k views

How to filter custom posts by tags and custom fields?

I'm planning a site for a client who wants users to be able to filter upcoming events by the following criteria: Type i.e. Comedy, Theatre, Music etc. Date Daily or Weekend Duration Daily or Half ...
4
votes
1answer
2k views

Create page to handle form submission

I currently have some custom post types "shops" (actually more like pages than posts) and a custom taxonomy "products" linked to those post types. I'm attempting to create a form (via shortcode) that ...
4
votes
2answers
240 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 ...
4
votes
5answers
3k views

How to replicate some of Drupal Views functionality in WordPress?

I admit, I still think in Drupal. (In choosing between developing in WordPress and Drupal, I still tend to favor Drupal, because I haven't yet figured out a few things on the WordPress side.) Can ...
4
votes
1answer
586 views

Creating a Custom Post Type for Inserting Preset Content into Post & Pages?

In response to Mike Schinkel's comment (see below) on my post about how to pre-populate content (essentially using a content template)... @Scott B I mean why did you support a file on disk ...
4
votes
2answers
568 views

Implementing “Video of the Day” Feature?

I'd like to add a new area on a WordPress 3.0 site that contains a new video from YouTube each day. This video would be manually picked, and manually added each day. I'm not sure how to properly set ...
4
votes
1answer
92 views

Restrict a Post Types Post Status

I have a custom post type and a completely custom user interface to access it, and would like these posts to have a publish status. I know how to make them skip trash and be deleted immediately, but ...
4
votes
1answer
161 views

How make get_next_post() return first post when viewing last one

I need a way to link to the first and the last post (CPT) created. For example, I'm in the last post and if I click in "next" I should go to the first. Now i have this <?php $next_post = ...
4
votes
1answer
2k views

How to make a WP_Query search with custom post types?

I've registered a custom post type called "node". When I create a basic WP_Query to get posts of that type, it works just fine. Example: $args = array( 'post_status' => 'publish', 'post_type' ...
4
votes
1answer
1k views

Using Custom Fields in Custom Post Type URL

I'm developing a car site that has showrooms. Each showroom needs it's own custom URL based on it's location. The location (City and County/State) is already inserted as two custom fields. So for ...
4
votes
1answer
894 views

Post revisions don't save or show up only for custom post types

My website makes use of a number of custom post types as well as the traditional "posts" and "pages" types. For all "posts" and "pages" revisions show up as they should, with a history of edits ...
4
votes
1answer
365 views

Custom post type capabilities

I've got a somewhat unique scenario that I would appreciate some assistance with. I have a custom post type, coin, for content that is automatically created by an custom import process. I would like ...
4
votes
1answer
374 views

When we register a custom taxonomy or post type, does the WP database modified at all?

When you use the register post type and register taxonomy functions in your functions.php, where do all that setting info get stored in regards to the CT's and CPT's you are registering? I'm talking ...
4
votes
2answers
686 views

Display Editable Text Above CPT Archive Listings

I have two custom post types (Authors and Partners). I display their archive page's in the main navigation and use archive-authors.php and archive-partners.php to make a couple small tweaks to the ...
4
votes
3answers
650 views

Hierachical Custom post types permalinks not working

Been looking for someone with this same problem for hours now so I decided to post my own thread. I have a hierachical custom post type called contact-information. Using this I have parentpages ...
4
votes
1answer
855 views

How can I filter posts by post_parent in the admin?

I have followed this tutorial and this one to add a custom column to a custom post type edit screen, showing the post parent of each post. My question: How can I make the post parent clickable just ...
4
votes
2answers
26 views

How can i avoid the permalink start with 'blog' while using the custom post type?

I used the custom Structure /blog/%category%/%postname%/ for blog. also i have a custom post type named 'FAQ' while viewing the faq posts, it is showing the /blog/faq/%faq_category%/%postname%/. When ...
4
votes
2answers
68 views

Pushing a custom post type to the top of the search results

Apart from posts and pages there are profiles on my site. Does exist some way how could I push them to the top of the search results? Currently, results are ordered at first by keyword and then by ...
4
votes
1answer
219 views

Category as Class for Custom Post Type

I've only just realised that custom post types don't appear to output the category as a class in the loop, via post_class and I wonder if anyone can suggest a work around. Is this something that ...
4
votes
3answers
659 views

Query custom post type by custom field

General Info I used the plugin WP Types (wp-types.com) to create a custom post type called "artist". In WP Types you can also set another post type as parent post type. This is not possible by ...