Jump to content


Photo
- - - - -

Custom Post Types


  • Please log in to reply
10 replies to this topic

#1 dxbrich

dxbrich

    Newbie

  • Members
  • 6 posts

Posted 09 June 2011 - 09:42 AM

Hi, I've just installed the platform pro update and have added a custom post type in my child theme. I have added several new meta fields to this for a catalog of boats. These are saving correctly, but how do I make these visible on my custom post. This is the link to the test server:

Please Login or Register to see this Hidden Content

The custom post is called portfolio and in a normal template I would used single-portfolio.php - I don't think this is applicable in platform pro. Thanks, Rich

#2 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 09 June 2011 - 03:43 PM

Hi Richard, Actually, PlatformPro now supports custom templates. Which version are you running, please? If you have base activated, there should actually be an example in there as well.

#3 dxbrich

dxbrich

    Newbie

  • Members
  • 6 posts

Posted 09 June 2011 - 03:46 PM

Hi Kate, I have PlatformPro 1.5.0 and PlatformBase 1.4.1. Is that the most up to date? I upgraded this morning to take advantage of the custom post types. Rich

#4 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 09 June 2011 - 04:11 PM

Hi Richard, Yep... that should be good. Did you see the example in base?

#5 dxbrich

dxbrich

    Newbie

  • Members
  • 6 posts

Posted 09 June 2011 - 04:32 PM

Would that be this - based on template.override.php :

Please Login or Register to see this Hidden Content

Would I just make templates.portfolio.php? If so, what would I populate this file with?

#6 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 09 June 2011 - 08:24 PM

all posts/pages are handled by one file in PP...template.postloop.php. You can use this file in conjunction with wordpress conditionals to create the custom post type output.

#7 dxbrich

dxbrich

    Newbie

  • Members
  • 6 posts

Posted 10 June 2011 - 09:14 PM

Thanks for the responses guys. Very new to Wordpress and php (background in ColdFusion) - so this is all a bit tricky. I've solved this all now using hooks and the functions.php file in the child theme. Looking forward to more customisation!!

#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 10 June 2011 - 09:31 PM

Well done for solving it, any chance you can post your snippets for next person?

#9 dxbrich

dxbrich

    Newbie

  • Members
  • 6 posts

Posted 10 June 2011 - 09:50 PM

To start off with I needed to add my extra meta information to the bottom of a custom post. Like all of this customisation it was carried out in the fucntions.php file of the child theme.

Add Custom Meta to Post

Please Login or Register to see this Hidden Content


I know it's a little clunky, but a table was ideal to show this information in the format required.

Within the custom post types I have 2 categories and I wanted to be able to display each category on a separate page. The conditional statement chooses between the 2 categories for the required pages.

Please Login or Register to see this Hidden Content


Again this is a bit clunky and I'm sure I will refine it for the launch of the site. I just wanted to get the process working for the client.

Rich

#10 Danny

Danny

    Is Awesome!

  • Moderators
  • 16376 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 10 July 2011 - 01:00 PM

Hi, Ive jsut started to add custom post types to my test site using the Custom Post Types UI plugin and I noticed you have the same issue as I do. I have created a post type called Rumors and when I goto my test post the links URL looks like this and works. MySite.com/rumors/rumors-title As does yours but when I goto this URL MySite.com/rumors And do the same on your webiste

Please Login or Register to see this Hidden Content

We both get a 404, how do I set this to show a list of the posts from that Post type ? Thanks Danny

#11 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 08 August 2011 - 10:45 PM

The solution is very simple. Go to Custom Post Types UI settings and edit your post type. Click on advanced options, and then check "has archive". Thats it, it will create an archive page for you that uses the pagelines loop, so it looks just like any other blog page.