Converting From A Custom Post Theme
I have a friend that wants to convert to Atahualpa after using a very restrictive theme. The only catch is that the theme has a bunch of Custom Post templates.
What will happen to the existing Custom Posts if I just activate Atahualpa? Will they be preserved into default format? And if so, what happens to the Custom Field content? Is there a clean way to preserve the Custom Post types? I'm assuming I have to make new templates. Do I just have to duplicate the Custom Fields into the new templates? Thanks! |
You could try the 'Custom Post Type UI' plugin
|
I don't believe this plugin has an export function. Does the standard WP export tool support Custom Post Types or is there another plugin that works for that?
|
To the best of my knowledge, all the data that makes up the custom posts is stored in the normal wp database tables
|
This plugin imports Custom Post Types from CSV:
http://wordpress.org/extend/plugins/csv-importer/ However, the native WP exporter is in XML. Is there a way to export as CSV? |
did you try the plugin I mentioned? if you are worred about the database do a backup before you do anything else.
|
I did, but I don't see any export/import function on there -- at the very least, to exactly copy the CPT, since it's a pretty complex form and I'm new to CPTs. If I have to do it manually, that'll be a last resort.
|
I think I figured out one of the issues -- after doing a little bit of digging, it sounds like CPTs built into the old theme's template don't play nice with plugins.
|
Sorry I was thinking about the new post formats.
I think with custom post types you may have your work cut out for you. Atahualpa will process the standard posts and pages so you may have o ode a plugin or custom template to process those posts. Can you convince your friend to do things differently? |
I've almost come up with a solution. I've installed the Custom Content Type Manager and created the CPT with replicated Custom Fields from the original.
Then I moved the Kicker below the Body in the Atahualpa index.php file. Then I added the meta items per this post: http://forum.bytesforall.com/showthread.php?t=17324 I surrounded each meta item with its own Div to create classes for styling. It replicates the capabilities of the original theme. Now, the only thing I have left is configuring the excerpts on the main Custom Post Type page ("Books"). Is there a way to set the main blog posts to display the full post and the CPT to display the excerpt? The URL for the CPTs is /?post_type=books if that makes a difference. |
Is there a way to identify the cpt via a test (ie is_cpt()?)
If so you could edit the theme where the excerpt is created and add the test in there |
I found this here: http://stackoverflow.com/questions/1...onal-wordpress
"<?php if ('project' == get_post_type() ) { ?> // Get content <?php } ?>" So if that's the case, my CPT is "books" rather than "project". Is that something I can use? PHP isn't my strong suit. |
what you could try is editing bfa_get_post_parts.php and at line 143 add
HTML Code:
if (get_post_type() == 'books' ) { $do_full_post = 0; } |
Almost works -- it pulls it as an excerpt on the Home page, which is good -- but on the single posts, it's still pulling the excerpt rather than the full post.
Is there a way to make it an excerpt display conditional for both CPT = Books and Page = Home? |
ok, what are all teh conditions ie
on the home page make teh cpt an excerpt and others full posts on a single post page...... |
Yes, exactly:
On Home, show full normal posts and excerpt CPTs On single posts, show full CPTs |
so change teh code to
HTML Code:
if ( (get_post_type() == 'books') and !is_single() ) { $do_full_post = 0; } |
That works! Thanks for the PHP lesson, I'll put it to good use. This configuration has been a heck of a learning experience.
One more question, if you don't mind. Where can I edit the content of the excerpt? For example, if I want it to pull one of my custom fields, where can I insert that? |
Quote:
1) automatically - then the first NN words make upo the excerpt 2) manually - you manually create an excerpt in the post editor in case (10 you can't change the excerpt except by changing the post while in case (2) you just edit the manual exceprt in the post editor |
Thanks for all your help, JD. I hope you got my donation ok.
I've used conditional PHP on index.php to show some custom fields on below the excerpt and all of them on the single post. However, the custom fields below the excerpt show up after a hard break. I want it to have the same indent as the excerpt next to the featured image. That's why I was hoping to have the excerpt area automatically call out a custom field. If that's possible, that'd be great. Otherwise, I can force it with CSS. You can see my test site here for an example: http://www.mikechenwriting.com/test/?post_type=books |
All times are GMT -6. The time now is 12:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.