Questions tagged [custom-post-types]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
240 views

In WordPress how do you create a custom post type with the author's name in the slug?

I'm trying to build a new WordPress theme using register_post_type to create a custom post type called listings. I would like each listing to have the following permalink structure: http://www....
0
votes
2answers
5k views

Adding CSS to custom post type admin page causes error

I have this bit of code in my Meteor Slides plugin that loads a stylesheet on the admin pages of just the slides custom post type: add_action('admin_head', 'meteorslides_admin_css'); function ...
0
votes
5answers
2k views

How does one flush rules on theme activation or deactivation only?

Flushing rules is clearly an important part of creating themes with custom post types. See here and here. Does anyone have any example code of how to flush rules from functions.php? I'm a little ...
1
vote
2answers
226 views

Using wordpress template tags within an array

A bit of a noob PHP question coming up. I am trying to create a generic archive style view for my custom post types. Ideally I want to create one generic template that can be used for all post-types. ...
3
votes
3answers
902 views

Issues when rewrite rules collide?

Is it a problem to have a custom taxonomy and a custom post type use the same rewrite structure? I have a custom taxonomy people and a custom post type people_bio. The idea is that you get a list of ...
30
votes
7answers
30k 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 ...
1
vote
1answer
2k views

WordPress custom post type Single.php?

I have a WordPress custom post-type setup. I've created single-[customposttype].php However instead of displaying only the requested custom-post-type it goes to the URL, then displays all of the ...
4
votes
2answers
7k views

is_home() and is_single() Not Working as Expected with Custom Post Types?

(Moderators note: Was originally titled: "Custom post type problem?") I'm having some problems with custom post types where everything is working great except for the sidebars. Here is some code ...
0
votes
1answer
6k views

Displaying custom posts by category

I can get custom posts to display on my site. However, I want to filter the posts by category. The custom posts are displaying on this page: http://www.africanhealthleadership.org/resources/...
2
votes
1answer
4k views

Assigning Multiple Layout Designs with Custom Pages in WordPress?

(Moderator's note: This question was previously titled "How to add multiple custom page in wordpress") I am developing a WordPress site and right now I have a custom home page and others are default ...
5
votes
2answers
7k views

How to handle a hierarchy with custom post types

I have moved into WordPress for a few days and was quite impressed by all the available features, plugins and polished themes. I have spent quite some times reading documentation about themes and ...
0
votes
1answer
392 views

How can I display a drop-down select of Post Names

I would like to add a custom write panel to a custom post type. I'm looking at the the code here: http://wefunction.com/2009/10/revisited-creating-custom-write-panels-in-wordpress/ I can get the ...
3
votes
3answers
932 views

How can I combine posts of different types in one hierarchy?

I'd like to create a custom post type and add this as a child post of some but not all existing standard posts (which are not pages). Is this possible? Can I, for example, create a custom post type ...
2
votes
1answer
4k views

Parent drop-down not appearing for custom post type

I'm trying to create a custom post type that I can associate with parent posts (they are posts not pages). Wordpress is version 3.0.1. I was hoping to see a list of posts in a parent post drop-down ...
2
votes
2answers
4k 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 ...
7
votes
2answers
9k views

display different template based on post type

Hay, i have a custom post type "Events", however this is basically a post type, so it inherits the post.php template page. Is there anyway to use a different template (i.e events.php) if the content ...
31
votes
6answers
43k 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, ...
2
votes
1answer
568 views

List Posts of a Custom Post Types Ordered by Terms of a Custom Taxonomy?

I've created a custom post type and custom taxonomy. I can now create a new post and associate it with a custom category. The problem is listing these news post types. This: $loop = new WP_Query( ...
4
votes
2answers
268 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 ...
0
votes
2answers
1k views

Change ordering of fields of custom post type in admin page

I have a custom post type and am placing in custom meta boxes. How do I change the ordering of the fields of a custom page in the admin? For example, I have a custom field called subtitle. How do I ...
3
votes
2answers
2k views

How to generate a sitemap with custom posts (not Google XML)

I'm looking for a way to generate a sitemap for display on my site that includes my custom posts. I'm not looking for an xml sitemap generator for search engines -- that is sorted using Google XML ...
3
votes
1answer
9k views

Get the 'slug' of a custom taxonomy

Use case: I have a custom post type of 'show' for a music venue. In the sidebar we want to display any related 'show' to the current one on single-show.php. They will be related by a custom taxonomy ...
1
vote
1answer
2k views

Add text to post list/edit screens?

I'd like to add some descriptive text underneath the page title on both the list and edit post screens for the default post and also custom post types - e.g. "Below is a list of your recent blog posts....
2
votes
2answers
3k views

Displaying Post Title on Post Edit page?

I'm trying to include the post title in a custom post type edit screen. For example if the post is called Biography, I want the edit page title to be 'Edit Biography'. I'm using the below code: ...
4
votes
5answers
4k 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 ...
2
votes
6answers
16k views

Including Custom Post Types in “Recent Posts” Widget

I'm able to easily include my custom post types into my main loop by making small adjustments with query_posts(), but I'm not sure how I would go about including custom post types in the "Recent Posts"...
5
votes
2answers
7k views

Defining capabilities for custom post type

On creation of a custom post type I'm trying to define capabilities but it's not working. What's wrong with this code? $args = array( 'labels' => $labels, 'public' => true, '...
1
vote
1answer
624 views

Custom Post Types and Categories?

For the life of me I cannot seem to get categories to come into existence with my custom post type. I've added the following — simple — code to the bottom of my theme's functions.php file, ...
1
vote
2answers
4k views

Changing 'view' link for custom post type on list post screen?

How can I change the page that the 'view' action links to on the list post screen for a custom post type? Update I've got it to work with normal post types using the below code but where do I define ...
4
votes
2answers
2k views

Allow user to Edit Posts but not Add New?

For one of my custom post types I want a specific user to be able to edit existing posts created by admin but not be able to Add New posts. How can this be done? If I define the user role as not ...
4
votes
3answers
13k views

Breadcrumbs with Custom Post Types?

I've tried both Yoast Breadcrumbs and Breadcrumbs NavXT and I can't seem to get either to work with custom post types. Anyone had any luck with this? A single 'News' post on my site displays: Home -> ...
1
vote
2answers
3k 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 ...
16
votes
1answer
10k views

Customize Edit Post screen for Custom Post Types?

What's the best way to completely customize the Edit Post admin screen for a specific custom post type? I have customized it to an extent already on creation of the custom post type - adding ...
6
votes
3answers
4k 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 "...
3
votes
1answer
849 views

How to Programically add to the new WordPress menus

Pre WordPress 3.x I was using: add_action( 'init', 'product_register' ); add_filter( 'wp_page_menu', 'custom_page_nav', 90 ); function product_register() { // register_post_type( 'product', $...
3
votes
1answer
585 views

Sorting for each custom taxonomy

I have a custom post type called Baseball Players which contains teams, positions, and a league taxonomy. A team consists of the team name, logo, description, and coach. A position just consists of ...
1
vote
2answers
651 views

Wordpress Custom Post Type Repeated 404 Errors

I've got a WordPress CPT that I've had running for a couple weeks. There weren't any problems with it. In the last couple days, it's been going haywire. Every few minutes, WordPress forgets that the ...
1
vote
2answers
1k views

Using Default WordPress Custom Header Image Crop Feature in a Post Type / MetaBox

I am not sure how many of you have experimented with the new custom header image functionality of wordpress 3.0 but its actually very cool (enabled by adding the function to your functions.php file). ...
0
votes
2answers
310 views

Custom post types

I have made a custom post type called "Case Studies". There is a case studies page which displays the title of every custom post and a small exceprt. However when you click on the title to view the ...
3
votes
3answers
2k views

How to create a mini directory in WordPress?

I'm looking to create a simple directory, something similar but not so powerful as SOBI2 for Joomla. Is there something like this for Wordpress? I want to store informations like: Name URL Address (...
1
vote
1answer
1k views

Menu with Automatic Pages Included from Custom Post Type

Question - How can one utilize the wordpress 3.0 Menu system to automatically have new pages from a custom post type included within the menu (I am referring to the Menu Management area of wordpress ...
6
votes
3answers
7k 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 ...
5
votes
1answer
3k views

Automatically sorting custom post type admin area by a custom field

I have created a custom post type to display future events, with the event's date stored in a custom field (YYYY/MM/DD format). I'd like the admin screen for this custom post type to be automatically ...
15
votes
1answer
10k 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 ...
15
votes
2answers
5k 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 ...
0
votes
1answer
373 views

Which file/template is in charge of taxonomies for custom post types?

I have set up a CPT, lets say "Movies". 'rewrite' => array( 'slug'=>'movies', 'with_front'=>FALSE ) I added a taxonomy "Genre". 'rewrite' => array( 'slug'=>'movies/genre', '...
19
votes
3answers
7k views

What Is The Use Of map_meta_cap Filter?

What is the use of map_meta_cap filter? This filter is not documented anywhere. I have an unclear idea of what it could be: Used to map the permissions of the user to operations on posts. What ...
1
vote
1answer
2k views

How to duplicate fields in custom post types?

Lately I've been using Magic Fields quite alot. One of it's great advantages is the ability to duplicate a group - i.e. give the post/page author the ability do create multiple "meta-boxes" at will. ...
10
votes
3answers
15k views

How can I bulk upload images and automatically create posts for each one at the same time?

I know how to upload multiple images into an existing post, but this is a different scenario. This is for a large catalog of assets, with each custom post-type post representing an image asset (thus a ...
0
votes
2answers
100 views

Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?

One of the best blogging practices is that of writing "pillar posts" - featured content that's longer than a typical post and will likely generate a high volume of traffic to your site. Extensive ...