[Plugin: WP Easy Post Types] Easy Post Types & Permalinks
When I check “Use pretty URLs” (under “Edit Fields” in the “Easy Post Types” menu), the links to view the posts stop working.
Otherwise, great plugin. Thanks!
Oh, and a couple of questions:
Is there any way to specify a particular template to use to display custom posts?
And what is the PHP code to show all the posts of a particular post type?
I.e., I’d like to have a Custom Posts template just like I currently have a Category template.
I figured out the template issue for individual custom posts. Here is the answer in case anyone else needs it:
Say you have a Custom Post Type called “Events.”
You need to create a new template file called single-events.php
(I just duplicated single.php and changed its title and fiddled with the inside a bit to remove stuff I didn’t want showing up for this custom type.)
And if you want to add individual custom fields to the inside of the template, here’s the PHP code:
<?php echo get_post_meta($post->ID, 'field-name',true) ?>
You would replace ‘field-name’ with the name of your field — in the case of the Events post type, for example, that would be ‘location’, like this:
<?php echo get_post_meta($post->ID, 'location',true) ?>
And here’s how to do the query to get just particular custom posts:
<?php query_posts( array( 'post_type' => 'location' ) ); ?>
And if you want to do multiples types in the list:
<?php query_posts( array( 'post_type' => array('page', 'location') ) ); ?>
Thanks for your notes, helped me a lot!! Do you know how to make a certain number of posts appear on one page and the other on the next?
$wp_query = new WP_Query("post_type=films&post_status=publish&post_per_page=5");
in a while loop but it doesn’t create any pages, I see all my posts on one page only. Any ideas?
If you go to your wp-admin page, click on “Settings” and click “Reading” you can set how many posts you want to come up per page.
Do you do want to create a custom archive page with a certain number of posts?
Then you need to add the following at the bottom:
<?php next_posts_link('« Older Entries') ?> <?php previous_posts_link('Newer Entries »') ?>
Oh I know that, and it seems to be working for normal posts, but with the custom post types created with this plugin, the pages are not getting created. Thanks anyways, will check the admin section again =)
@maria, I had the same problem with the “pretty URLs”, but solve it by putting only /%postname%/ (without %month% and so on) as Custom Structure within the Permalink Settings.
Thanks for the information. We will add some of this information to our documentation and will have that available in a future release. Thanks for using Easy Post Types!
I created a single-post.php for my ECPT posts and I’m still getting 404’s.
How do I point a single post from a page of custom posts to a “single” post page?
I think you should call your custom post type something other than “post” since the “Post” type is already taken. Just a guess.
I installed this plugin into a WordPress installation and it fracked up the front page by causing it to redirect to a long URL at same domain. I’m not sure what method is causing the redirect so I can’t disable it.
The site is clunkerjunker.com, when u visit u will see where it redirects.
I don’t have the backend coder know-how to comprehend how a WP plugin may have redirected my homepage elsewhere but it sure as hell did. Any clues as to how to fix it?
Thanks so much!
Hi Joshua – we will take a look at this as well. We’re going to have a new release here in the next couple of days that should resolve most if not all issues found in the forums. Thanks.
Thanks very much for providing this fantastic plugin for creating Custom Posts. I tried a few others and this one was most stable.
The one issue that I’ve found:
When choosing ‘Use pretty URLs’, the url changes to a pretty url, but I receive a 404 on the front end.
I look forward to your next release.
- The topic ‘[Plugin: WP Easy Post Types] Easy Post Types & Permalinks’ is closed to new replies.