|
#1
Jul 25, 2012, 10:09 PM
|
|
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!
|
#2
Jul 26, 2012, 04:29 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
You could try the 'Custom Post Type UI' plugin
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
Jul 26, 2012, 05:09 PM
|
|
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?
|
#4
Jul 26, 2012, 06:07 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
To the best of my knowledge, all the data that makes up the custom posts is stored in the normal wp database tables
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#6
Jul 29, 2012, 03:20 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
did you try the plugin I mentioned? if you are worred about the database do a backup before you do anything else.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#7
Jul 29, 2012, 04:26 PM
|
|
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.
|
#8
Jul 29, 2012, 04:42 PM
|
|
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.
|
#9
Jul 29, 2012, 05:29 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#10
Jul 29, 2012, 10:56 PM
|
|
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.
|
#11
Jul 30, 2012, 05:58 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#12
Jul 30, 2012, 10:41 AM
|
|
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.
|
#13
Jul 30, 2012, 03:10 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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; }
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#14
Jul 31, 2012, 09:47 AM
|
|
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?
|
#15
Jul 31, 2012, 11:54 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
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......
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#16
Jul 31, 2012, 11:31 PM
|
|
Yes, exactly:
On Home, show full normal posts and excerpt CPTs
On single posts, show full CPTs
|
#17
Aug 1, 2012, 05:05 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
so change teh code to
HTML Code:
if ( (get_post_type() == 'books') and !is_single() ) { $do_full_post = 0; }
this says 'if the post type is 'books' and this is not a single post page then do an excerpt
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#18
Aug 3, 2012, 11:52 AM
|
|
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?
|
#19
Aug 3, 2012, 02:16 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Quote:
Where can I edit the content of the excerpt?
|
There are two ways to have an excerpt with Atahualpa,
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#20
Aug 3, 2012, 04:19 PM
|
|
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
|
|