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

learn more… | top users | synonyms (1)

7
votes
2answers
2k views

Use template_include with custom post types

I want to check for an appropriate template in the theme folder before falling back to the file in my plugin directory. Here’s my code: add_filter('template_include', 'sermon_template_include'); ...
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 ...
3
votes
1answer
2k views

Is it possible to define a template for a custom post type within a plugin independent of the active theme?

I'm writing a plugin to manage data about open-source projects. I developed an object model and have successfully created all custom post types and taxonomies, as well as implemented the correct ...
10
votes
3answers
4k views

Custom Post Type Slug / Page Slug Conflict - Prevent use of reserved slug on page save?

I have a custom post type of portfolio (slug portfolio) in my theme and all is working well except one thing. When people create a page with a slug of portfolio, eg: example.com/portfolio, the theme ...
5
votes
3answers
2k views

How to use a custom post type archive as front page?

I'd like to use a custom post type archive as a site's front page, so that http://the_site.com/ is a custom post type archive displayed according to my archive-{post-type}.php file. Ideally I ...
1
vote
2answers
492 views

Limit the post for differents custom post type in the same wp_query

I have three custom post type: books magazine videos Now i want to limit the number of post for custom post type, for example: books => 3 post magazine => 2 post videos => 1 post I used a ...
3
votes
1answer
3k views

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

This answer provides the code for a query that returns an OR match on a taxonomy term: global $query_string; $args['tax_query'] = array( array( 'taxonomy' => 'status' ,'terms' ...
2
votes
1answer
1k views

Can I change a custom post type label from a child theme?

I'm developing a child theme of a premium template, this comes with a custom post type with the label name of "Projects" but I'd like to change it to something else, I know that if I go to the ...
4
votes
1answer
4k views

Creating Photo Gallery System with Custom Post Type

I'm creating a movie blog using WordPress. I have Movie and Trailer custom post types and I want to add a Photo feature for this and I want to add a relationship between this photos and Movie CPT. ...
7
votes
6answers
10k views

Get terms by taxonomy AND post_type

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to ...
7
votes
1answer
547 views

Efficient Taxonomy Intersection

I have many uses for this but I want to know the most performant way of doing what is going to be an expensive operation. As an example I will use a shop. Given: A product brand taxonomy A product ...
6
votes
2answers
5k views

Load a script just to custom post type in admin

I have created a custom post type "portfolio" with something like this : $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => ...
4
votes
2answers
14k views

How to create a custom search for custom post type?

I have a search field for the blog posts, but I need an other for a custom post type. How can I create this custom search form with a different search result layout?
5
votes
1answer
4k views

How to assign specific users the capability to edit specific pages / posts / custom post types

I'm trying to implement what seemed like a relatively straight forward idea, basically I am building an access control plugin to control viewing and editing of a custom post type (in this case ...
3
votes
2answers
2k views

Custom post type taxonomies URL rewrite

What I want to achieve is an online listing catalog with a URL like this: www.example.com/drawing-tools/brand/type/material/color/ In this example, I have a custom post type named "drawing-tools" ...
8
votes
2answers
4k views

How to Remove Certain Screen Options and Meta Boxes from add/edit post type?

Now, when you add or edit a particular post within your desired post type, there are more screen options as well. Although, these Screen Options are showing/hiding meta boxes. I would like to be able ...
5
votes
3answers
2k views

Use register_post_type() to modify an existing post type

There are lots of situations where a theme or plugin registers a post type and you want to modify it. There is of course add_post_type_support() and remove_post_type_support(), but those don't give ...
4
votes
3answers
3k views

Creating a default Custom Post Template that a Theme can override

I'm in the midst of building a Wordpress Plugin that adds a custom post type, for which I'd like to include a default template to display. Essentially, this is an event management plugin, and the ...
3
votes
1answer
3k views

How do I dynamically populate wp_nav_menu from a custom taxonomy?

I know this question has been asked in different forms. But as far as I can tell from searching Google and SE/WP it's never been satisfactorily answered. Let's say I have a taxonomy clubs and a ...
2
votes
2answers
3k views

Displaying Posts Related to Other Posts by a Taxonomy Term?

I have a custom post type for musician's profiles, and a taxonomy for their location (categorised hierachically into Countries and then Cities). On the musician's individual profile pages I need to ...
1
vote
3answers
2k views

Permalinks in Custom Post types

Is it possible for a custom post type to have a permalink as domain.com/custom-slug/ instead of domain.com/custom/custom-slug/? I can't seem to achieve it. rewrite argument while registering it ...
3
votes
2answers
5k views

Properly add an upload media button in a meta box field

i have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an Upload button that points to the wordpress media ...
1
vote
2answers
719 views

When you create a custom post type, does that also create capabilities for editing/deleting that post type automatically?

For example, if I create a post type called "destinations" does that automatically create capabilities like "edit_destinations" or "delete_destinations"?
3
votes
2answers
857 views

Sort custom post type list table by display name of a user id stored as post meta value

I have a custom post type named domicile. Each post (domicile) has an owner (not the author). Owners are users with a custom role. I store the user id as a post meta value (dmb_owner) for the domicile ...
3
votes
2answers
5k views

WP 3.1 - archive pages for custom content types possible now without a plugin?

I noticed that WP 3.1 supposedly has 'new CMS capabilities like archive pages for custom content types', however, I can't see that implemented yet? I've been using a plugin called 'Simple Custom Post ...
1
vote
2answers
3k views

How to order custom post type by multiple custom fields?

How to display posts with 'Event' custom type ordered by 'Start_Hour' and then by 'Start_Minute'? 'Start_Hour' and 'Start_Minute' are numeric custom fields. I tried this, but it doesn't work: $args ...
1
vote
4answers
904 views

Adding %author% in custom post type URL structure?

I'm trying to do some WordPress URL rewriting ... Specifically I have custom post type that currently works like this: http://mydomain.com/videos/post-title/ But I would like to have it located at: ...
0
votes
2answers
1k views

Custom-Taxonomy as categories: Remove “most-used” tab?

I created a custom-taxonomy for a custom-post-type which functions as kind of categories for this post-type. The Metabox for my taxonomy has two tabs. One for my Categories and a second tab called ...
7
votes
2answers
3k views

Creating a Custom Post Type as a Plugin? Why?

I've been experimenting with creating a Custom Post Type as a plugin (because I've seen this recommended in various places). But I have a question not about the how, but rather the why of building ...
5
votes
3answers
3k 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 ...
4
votes
4answers
6k views

How do I add a new custom post format?

How do I add a new custom format while making a post in WordPress? The default formats are standard, aside, image, gallery... I want to add a new format of 'xyz' name. How can I do it?
3
votes
2answers
1k views

How to order posts of a custom post type by date DESC in dashboard Admin?

I created a new post type named "Video". When I create post for the post type, posts is ordered by title ASC. Is it possible to order posts by date DESC please ? register_post_type('Videos', ...
3
votes
5answers
561 views

How to do a custom bookmarks post type?

Let me first explain what I am wanting to do... I am wanting to add all my hundreds of website bookmarks that I have now in my browser, into wordpress for the following reasons. Can search my ...
2
votes
1answer
4k views

Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT

Wondering if someone could tell me why sub pages (child pages) no longer work (eg: www.mysite.com/type/childpage). I have a page called "Type" (working fine), and I wish to have Child Pages of "Type" ...
2
votes
1answer
2k views

Categories assigned to custom post type not found

Here's my issue: I have assigned a custom post type to certain categories. When I search for these categories, either through search or entering the url directly. However, if I assign a normal post ...
2
votes
2answers
3k views

Wordpress 3.1 - How does one add sticky post capabilities to post types

In wordpress 3.1 they finally added the option of allowing posts belonging to a custom post type to be marked as "sticky"... what I can't figure out though is how to enable this so the admin menu ...
1
vote
1answer
907 views

Wordpress returns 404 on custom rewrite rule conflict in parameters

I have been following the steps on the answer here and it worked wonders. But my problem is on this part, on the original: add_filter('rewrite_rules_array', 'mmp_rewrite_rules'); function ...
1
vote
1answer
394 views

Automatically create child pages when saving a (parent) page

I have a bit of a tricky one... I have a hierarchical Custom Post Type ('shows') that represents events. Is it possible for the user to create a new page (ie show), save the page and for Wordpress to ...
1
vote
1answer
819 views

Change custom post type to hierarchical after being registered

Very similar to this previous question: Changing 'rewrite' argument after custom post type is registered I am trying to make MarketPress Products hierarchical - I can do it with hacking the ...
1
vote
1answer
977 views

How to have a custom URL structure for a custom post type?

Even though this question sounds like others here is my problem: The site I am updating had a permalink structure of /%postname%, during this time I created a custom post type of "popups" (rewrite ...
0
votes
1answer
874 views

Dynamic page.php template for custom post types

I have a couple of custom post types registered. I would like to display all "posts" from each custom post type on its own page, and these pages must be visible in the nav menu. It would be great to ...
0
votes
1answer
2k views

Removing base slug from hierarchical custom post type

I have a hierarchical custom post type called "state". My goal is to have a permalink structure like thus: http://website.com/idaho/ http://website.com/idaho/sub-page I'm close but haven't quite ...
0
votes
1answer
2k views

how to create my own edit.php admin page code or template for my custom post type

Most plugins try to hide the components of the edit.php screen on wp admin and replace it with meta boxes to create the needed layout and fields for the custom post type. But this means that there is ...
0
votes
2answers
2k views

Define menu_order on Creation of New Custom Post?

I've created a custom post type called video and I'm using a plugin called Playlist_Order (which changes the menu_order field) to allow the user to use a drag and drop interface to order their videos ...
-5
votes
1answer
533 views

What does this PHP function code mean? [closed]

Can someone please help me to understand each part of this code? Can you comment every line so I can understand and custom the code accordind to my purpose. Here is the link in pastebin: class ...
5
votes
1answer
888 views

Custom post type for 'staff' versus using wordpress user profiles?

A scenario I keep coming across is where an organisation might have several staff for whom I want to have some sort of listing and a single profile page with biographical information. Typically I ...
4
votes
1answer
635 views

Make featured image required

Is it possible to force user to set featured image on some types of posts. For example I've got custom post type mm_photo and I want to show some error message or somehow block user from publishing or ...
3
votes
2answers
511 views

Copy a Taxonomy Term into the Post Title for a certain Custom Post Type

I am using Gravity Forms to allow users to create posts from the front end. However, the way this site I am building is going to work, one specific Post_Type is essentially just a "Data" post. There ...
2
votes
1answer
206 views

How to prefix post permalinks with /blog/ - without affecting custom post types?

I have several custom post types, which are properly structured as /%post_type%/%postname%/, however I wish to have the same effect for regular blog entries: /blog/%postname%/ If I prepend the ...
2
votes
2answers
310 views

Create an Info/Help message at top of a custom post type

I'm wondering how you go about creating an info/help message at the top of a custom post type in WP's dashboard? I often see these at the top of plugins and Id like to do the same thing for my custom ...