Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Converting From A Custom Post Theme


  #1  
Old Jul 25, 2012, 09:09 PM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 26, 2012, 03:29 AM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 26, 2012, 04:09 PM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 26, 2012, 05:07 PM
juggledad's Avatar
juggledad
 
23,682 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
  #5  
Old Jul 29, 2012, 01:27 PM
bswb97
 
158 posts · Aug 2010
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?
  #6  
Old Jul 29, 2012, 02:20 PM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 29, 2012, 03:26 PM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 29, 2012, 03:42 PM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 29, 2012, 04:29 PM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 29, 2012, 09:56 PM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 30, 2012, 04:58 AM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 30, 2012, 09:41 AM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 30, 2012, 02:10 PM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 31, 2012, 08:47 AM
bswb97
 
158 posts · Aug 2010
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  
Old Jul 31, 2012, 10:54 AM
juggledad's Avatar
juggledad
 
23,682 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  
Old Jul 31, 2012, 10:31 PM
bswb97
 
158 posts · Aug 2010
Yes, exactly:

On Home, show full normal posts and excerpt CPTs
On single posts, show full CPTs
  #17  
Old Aug 1, 2012, 04:05 AM
juggledad's Avatar
juggledad
 
23,682 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  
Old Aug 3, 2012, 10:52 AM
bswb97
 
158 posts · Aug 2010
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  
Old Aug 3, 2012, 01:16 PM
juggledad's Avatar
juggledad
 
23,682 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  
Old Aug 3, 2012, 03:19 PM
bswb97
 
158 posts · Aug 2010
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

Bookmarks

Tags
custom fields, custom posts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Parameters for a post. keysle Installing & running WordPress 1 Dec 20, 2011 02:37 PM
Custom post fields wwday3 Post-Kicker, -Byline & -Footer 8 Jul 28, 2009 11:39 AM


All times are GMT -6. The time now is 04:31 AM.


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