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

learn more… | top users | synonyms (1)

13
votes
3answers
12k views

Pagination not working with custom loop

I've got a custom loop that I'm using to display some Real Estate listings that will be available within 60 days. I'm calling it with the following function: <?php $sixtydays = date('Y/m/d', ...
27
votes
4answers
4k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
25
votes
4answers
8k views

Custom post types, taxonomies, and permalinks

This is driving me nuts and I'm sure it's simple but nothing I search for comes up with a simple structure (everything is very complex). I have a custom post type "product_listing" and a custom ...
18
votes
2answers
17k views

How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

I've been combing this site and google for the answer and I've come up completely empty. Basically I want to do exactly what this post asks, but I need a hierarchical taxonomy. The answer given in ...
68
votes
12answers
38k views

Adding a Taxonomy Filter to Admin List for a Custom Post Type?

I have created a Custom Post Type called 'listing' and added a Custom Taxonomy called 'businesses'. I would like to add a dropdown list of Businesses to the admin list for the Listings. Here is what ...
92
votes
9answers
12k views

Tips for using WordPress as a CMS? [closed]

I want to use WordPress as a CMS for a reasonably basic site rather than a blog. I have several pages and at the moment, I don't intend to have a "news" page. While there are ways to make this work, ...
9
votes
5answers
4k views

Change the text on the Publish button

Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button?
1
vote
1answer
2k views

Updating custom post meta with ajax

This AJAX function gets called on a click: $.ajax({ url: 'site/ajax.php', data: {id: $('section#single article input:last-of-type').attr('value'), cote: 'like'} ...
12
votes
3answers
4k views

Implementing a CrunchBase.com Clone using WordPress?

I wish to create something like CrunchBase.com with WordPress.org (So to have one website that is a "database", and another one, which is a blog, that connects to it). Is it possible? and how? ...
6
votes
3answers
4k views

Add extra parameters after permalink?

How can I add extra parameters after a permalink, specifically if I'm using a custom post type? For example, let's say http://mysite/album/record-name was the permalink. How can I make ...
14
votes
2answers
8k views

Mixing custom post type and taxonomy rewrite structures?

Basically I want to achieve a glossary using custom post types and have some issues setting up rewrites the way I want them to be. I want it like that: The main glossary URL: ...
5
votes
3answers
4k views

don't publish custom post type post if a meta data field isn't valid

I have a custom post type (CPT) called event. I have a meta box for the type with several fields. I would like to validate some fields before publishing an event. For example, if an event's date is ...
29
votes
2answers
17k views

How to sort the admin area of a WordPress custom post type by a custom field

When editing one of my custom post types I want to be able to list all entries by a custom field instead of the date they are published (which, for a custom post type probably isn't relevant). I got a ...
5
votes
4answers
4k views

Prevent post from being published if custom fields not filled

I have a custom post type Event that contains a starting and ending date/times custom fields (as metaboxes in the post edit screen). I would like to make sure that an Event cannot get published (or ...
5
votes
1answer
360 views

CPT Template Not Showing - Getting 404

I'm developing a Custom Post Type plugin, which works fine in dev. Now that I've moved it to production, I'm getting a 404 when I try to display the template for the CPT. So, two questions: 1- Is ...
0
votes
1answer
514 views

WordPress custom post type category pagination 404 Error

This problem is giving me a headache and I was wondering if anyone knew how to fix it. I have a custom post type called Review. Here is how it is defined: function codex_custom_init() { $args ...
11
votes
8answers
7k views

Remove taxonomy slug from a custom hierarchical taxonomy permalink

I created a 'forum' taxonomy, using these rules: register_taxonomy( 'forum', array('topic'), array( 'public' => true, 'name' => _a('Forums'), 'singular_name' => ...
12
votes
5answers
10k views

Include custom taxonomy term in search

I have two custom taxonomies applied to two custom post types. the terms list on the sidebar just fine and will list all posts associated with it. However, if you search one of the terms in specific, ...
7
votes
1answer
3k views

Custom bulk_action

I would like to add a custom bulk action to a custom post type. I came across the filter bulk_actions-screenid, which according to its documentation, would do exactly as I wish. However, after about ...
2
votes
1answer
628 views

Truncating custom fields

I'm using custom fields to pull a secondary description. I'd like to use the built in WordPress truncate but can't seem to figure it out. $desc = get_post_meta($post->ID, "youtube-desc", true); ...
10
votes
2answers
3k views

Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?

I need to create a custom post meta box(es) for my custom post type "Slideshow" (this post type is already created). Each metabox will hold the content in each slide slide and save it to ...
2
votes
2answers
5k views

Dynamic navigation for custom post type (pages)

I have a set of custom post types with the capability_type argument set to 'page' I want to include these in wp_list_pages() or similar so I can use the dynamic classes (such as .current_page_item ...
14
votes
4answers
25k views

Advanced search form with filters for custom taxonomies and custom fields

I'd like to build an advanced search form for a specific custom post type, having filters for that custom type's custom fields and custom taxonomies AND for another custom type's properties (fields ...
13
votes
5answers
6k views

Is there a way to get N number of WYSIWYG editors in a custom post type?

Is there way to have multiple WYSIWYG editors for a custom post type? For example, if I had a 2 column layout I wanted to have one editor for one column and another editor for the other.
6
votes
3answers
16k views

Submit post and upload image from front-end

I am trying to do something similar to the above question. I am trying to make users post and upload images from front-end. I have already done the post form and its working. I just followed and ...
11
votes
1answer
5k views

Saving Taxonomy Terms

I have an interesting problem which I hope someone can quickly answer. I have created my own metabox which, based on "MY METABOX CODE" (list below) is correctly displaying a dropdown list of all my ...
16
votes
3answers
5k views

Adding categories to custom post type in permalink

I know people have asked this before and have gone as far as adding the custom post type, and rewrite for permalink. The problem is I have 340 existing categories which I would like to continue ...
12
votes
2answers
5k views

Creating an Image-Centric Custom Post Type?

Does anyone have any tips for creating an image-centric custom post type? To elaborate, my blog has rotating header images, shown below: The two images in the top left are randomized, and exist as ...
12
votes
5answers
5k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
4
votes
3answers
5k views

Custom Post Type Archives by Date and Taxonomy

Lets use the classic example of a custom post type called "movies", with its own taxonomy called "genre". By registering the custom post type (with a "movie" slug), the permalinks are already set up ...
10
votes
5answers
2k views

How do you use a CPT as the default home page?

I have a client who's site will be making heavy use of custom post types to configure their site. But I'm between a rock and a hard place for their requested home page. In reality, the home page ...
2
votes
1answer
1k views

How to quickly switch custom post type singular template?

I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php ...
1
vote
2answers
1k views

Permalinks: custom post type -> custom taxonomy -> post

I am having trouble working with wordpress' rewrite rules, and could use some help. I have a custom post type called shows. All shows have a single custom taxonomy category show-category. A show ...
4
votes
2answers
2k views

Redesigning Custom Post Type “Add New” page

I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up without custom post types, then I ...
2
votes
2answers
3k views

Combining queries with different arguments per post type

I am building a section on a site where I am merging two different post types into one loop, and then displaying them randomly. The problem is, I'm having a hard time finding a way to limit the amount ...
0
votes
1answer
203 views

Exclude custom function content from certain pages

I have added a small custom function to display a little author bio blurb at the bottom of each blog entry in my functions.php file inside the current theme that I am using. So far so good, it is ...
0
votes
1answer
940 views

custom post type taxonomies UI radiobuttons not checkboxes

Is there a way to replace the default checkboxes by radio buttons in the custom post type taxonomy UI? I have custom post type 'questions' with taxonomy 'answer type' (single selection [radio button], ...
0
votes
1answer
1k views

Adding Categories across posts, and custom post types

I currently have a list of categories that go with my 'posts' I want the same categories to go with my custom post types 'services' and 'work' The following code, adds the tags and categories to the ...
16
votes
7answers
21k views

Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?

(Moderators note: Was originally titled "wp_nav_menu Ancestor class without children in navigation structure") I have a wp_nav_menu in my header which had three pages in it. When I am on one of those ...
5
votes
2answers
5k views

Quick edit screen customization

Possible Duplicate: How to show custom meta box on "Quick Edit" screen? I'm trying to edit the quick edit screen on my custom post type "visitor" so that I can add some options for my end-users. My ...
12
votes
2answers
9k views

How do you use orderby with meta_query in Wordpress 3.1?

Is it possible to order my list of custom posts, after filtering it with meta_query, by the meta data of my choice? For example, I have a custom post type called webinars. I am trying to list all ...
7
votes
2answers
2k views

Handling front-end file uploads, considering safety and ease of use

I'm looking to adapt an existing forum-like plugin which has no facility for attaching media. The plugin works as a Custom Post Type, so it would be as "simple" as attaching an image to a post. I am ...
10
votes
5answers
2k views

Can the Next/Prev Post links be ordered by menu order or by a meta key?

I have a series of posts that are ordered by a meta_key value. They could also be arranged by menu order, if necessary. The next/prev post links (generated by next_post_link, previous_post_link, or ...
8
votes
3answers
3k views

Custom Post Type Data in Sidebar widgets?

(note: this question was originally about Custom Fields, but @MikeSchinkel had a better solution involving Custom Post Types) On my site I have several pages which I want to show the same data in the ...
6
votes
4answers
3k views

How do I append multiple taxonomies to the URL?

Multiple taxonomies in URL How does one append multiple taxonomies to the URL having the following: Post Type: products Taxonomy: product_type Taxonomy: product_brand Adding new ...
4
votes
1answer
8k views

Rewriting a custom-post-type permalink with taxonomy term?

I'm trying to rewrite my url for a custom_post_type named wr_events with one of its custom_taxonomy terms from event_type add_action('init', 'wr_events'); function wr_events() { ...
4
votes
1answer
2k views

Linking Two Post Types

and thanks in advance for your help. I've done some searching, and this question has been answered a couple of times with reference to the "posts 2 posts" plugin, but the documentation on that is ...
3
votes
1answer
4k views

Get monthly archives for custom post type

I know this is a rather common topic, but I can't seem to resolve the issue I'm having. Any help is greatly appreciated, I'm spinning my wheels at this point. Using Custom Post Type UI plugin, I've ...
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
1k 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 ...