custom-post-type

How to create a custom post type with file input in wordpress 3.0?

I'm pretty new to wordpress and haven't found a post on this but how do you create a wordpress custom post type that includes a file input? Also, I'm creating a portfolio page that will have 3 large images and a thumbnail. is using a custom post type with file input the correct route? or should i be uploading my images some other way and...

How to access biographical info while in WordPress Admin Editor?

While creating a new post in WordPress, how do I access the biographical info of the currently logged in user? I am asking because I created a new field called signature, and during post creation, I am making the biographical info as the default signature. ...

How to restrict text length of a field while in WordPress editor?

I would like to restrict the fields while creating a new post in WordPress. For the title, it should not exceed 40 characters. For the content, it should not exceed 400 characters. If these maximum values are exceeded, I would like to show an error message and not let the user continue. How do I do that in WordPress? ...

How to know the role of current user in WordPress?

While a user is creating a new post, how do I determine his current role? ...

How to throw a validation error in Wordpress?

Without using any JavaScript library like JQuery, how do I show an error to the user if the title of the Post exceeds 40 characters? I would like to use WordPress API/ PHP for this. ...

How to include all custom post types instead of only Posts

$this->add_meta_box( 'select_post_template', __( 'Post Template', 'custom-post-templates' ), 'select_post_template', 'post', 'side', 'default' ); To make a plugin work with custom post types, I've been told to change "post" to the name of the custom post type. Does anyone know if I can make it work with all custom post types (including...

Custom Post Type URL redirected wrong

I've got some Wordpress CPTs. They correct URL should be /wordpress/training/training-page/, and that's the URL I see in the admin manage page, but when I click the link the URL I end up with is /wordpress/blog/2010/05/21/training-page/. I deactivated my plugins with no success. Does anyone know how to keep the correct URL intact? Here...

Posts in Custom postype not visible on frontpage wordpress

Hi, I have created a custom post type restaurant. But Its not coming on the main page. But I'm able to see the post in single view when using the permalink. Is it that I have to make any changes in the index.php? If yes what changes? I'm using the default Twenty Ten theme in wordpress 3. And how can I get only the custom post type in a...

Page Navigation Within a Post with Specific post_type defined not working in Wordpress

http://lakers.sonikastudios.com/gallery/sample-gallery-post-1/ That post has several pages using the quicktag of Wordpress. This post is also is a custom post_type.. using the following code in the functions.php in the theme template. add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_ty...

How to exclude posts in taxonomy based on custom field?

I have a custom post type called 'real-estate' and a bunch posts (listings) within it. What I'm trying to do is create a handful of home styles and within them, specific listings of available homes. So right now, I have the search query pulling in only the home styles from the search by only showing results with the custom field "model...

Wordpress custom post type yearly/monthly archives

Is there anyway to have yearly or monthly archives with custom post types in wordpress? I've searched far and wide to no avail. I would imagine the url structure to be this: http://sitename/custom-post-type/year/month Anyone? ...

Iterate through custom post type by custom taxonomy type? (Ordering wordpress posts by category, or displaying custom post type by taxonomy term)

I want to have a page that shows all posts, separated by category. The idea is to get the categories, and then iterate through all posts for each category. The problem is complicated by the fact that I want to iterate through all posts of a given custom type, using a custom taxonomy as the categories. (Running Wordpress 3) In my functio...

Custom Post Type and Taxonomy Permalink Rewrite in WordPress 3.0.1

I have a 'story' Custom Post Type and 'artist', writer' Taxonomies. I need to set rewrite rules in the functions.php for the permalinks to look like this: Artist (Taxonomy/Category): http://www.example.com/isaac-deutscher (/%artist%) Writer (Taxonomy/Category): http://www.example.com/jean-paul-sartre (/%writer%) Story (Custom Po...

Utilizing WordPress's permalink structure on custom post types

I need to rewrite some URLs to custom templates. For example, I have a page at domain.com/page, and when a user clicks 'remove' on an element, it goes to domain.com/page/?remove=54. I'd like it to rewrite to domain.com/page/remove/54. Help is appreciated, thank you in advance! ...

Multiple Custom Permalink Structures in Wordpress

I have one Custom Post Type 'story' and two taxonomies, 'artist' and 'writer'. I have managed to get a Custom Permalink Structure like /%artist/%writer%/%story% by doing this (resumed code): add_action('init', 'custom_init'); add_filter('post_type_link', 'story_permalink', 10, 3); function custom_init(){ $story =...

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 posts in the custom-type. Here's a copy of the code i'm currently using: <?php query_posts("post_type=shorts"); while (have_posts()) ...

Custom Taxonomy in URL of Custom Post Type in Wordpress 3.0

I have a custom_post_type called book. I have a custom taxonomy called color. The post is assigned green which is a value of the color taxonomy. How can I have a url that is normally like this: website.com/book/post-name Become a url like this: website.com/book/green/post-name ...