Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Converting From A Custom Post Theme (http://forum.bytesforall.com/showthread.php?t=18052)

bswb97 Jul 25, 2012 09:09 PM

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!

juggledad Jul 26, 2012 03:29 AM

You could try the 'Custom Post Type UI' plugin

bswb97 Jul 26, 2012 04: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?

juggledad Jul 26, 2012 05:07 PM

To the best of my knowledge, all the data that makes up the custom posts is stored in the normal wp database tables

bswb97 Jul 29, 2012 01:27 PM

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?

juggledad Jul 29, 2012 02:20 PM

did you try the plugin I mentioned? if you are worred about the database do a backup before you do anything else.

bswb97 Jul 29, 2012 03: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.

bswb97 Jul 29, 2012 03: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.

juggledad Jul 29, 2012 04:29 PM

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?

bswb97 Jul 29, 2012 09: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.

juggledad Jul 30, 2012 04:58 AM

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

bswb97 Jul 30, 2012 09: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.

juggledad Jul 30, 2012 02:10 PM

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; }

bswb97 Jul 31, 2012 08: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?

juggledad Jul 31, 2012 10:54 AM

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......

bswb97 Jul 31, 2012 10:31 PM

Yes, exactly:

On Home, show full normal posts and excerpt CPTs
On single posts, show full CPTs

juggledad Aug 1, 2012 04:05 AM

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

bswb97 Aug 3, 2012 10: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?

juggledad Aug 3, 2012 01:16 PM

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

bswb97 Aug 3, 2012 03: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


All times are GMT -6. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.