Jump to content


Photo
- - - - -

Questions about Theming and custom post type

theming child theme custom post type

  • Please log in to reply
5 replies to this topic

#1 pracede

pracede

    Member

  • Members
  • 26 posts
  • Framework Version:Developper

Posted 22 June 2013 - 05:35 AM

Hi,

 

I found pagelines very good building web sites. But sometimes, plugins, sections and others features are not sufficient to meet some requirements. I want to display a custom post type on a special template. Here is the doc

Please Login or Register to see this Hidden Content

but there is not code query post or custom post from the database.

 

1. If my custom post type are jobs. How to do to display a list of jobs of a post ? Which query to use ?

 

2. If a want to display a single job, which will be the name of template file : page.job.php ?

 

 

I have download a classified plugin from mpmudev and when i log in to my website i see that a classifieds archive and classifieds template are created. See

Please Login or Register to see this Hidden Content

. My question is where i can find this template file because there are not in my child base theme ? You can see

Please Login or Register to see this Hidden Content

.

 

Thanks



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 22 June 2013 - 02:12 PM

Hi,

 

If your plugin is working within WordPress, which I presume it does, then its custom post types will be written to the postloop  PageLines Framework simply pulls the postloop and displays it on whatever template the PostLoop section is added to (see PageLines > Drag & Drop > Content Area).

 

You can create custom templates, and thus you can place the PostLoop on that template.  As our documentation on Custom Templates states, you can rename the custom page template to anything, following the conventions it describes.  See:

Please Login or Register to see this Hidden Content

 

I'm not sure what name the plugin requires or what code it requires to get its specific content on the page. There may be hooks needed.



#3 pracede

pracede

    Member

  • Members
  • 26 posts
  • Framework Version:Developper

Posted 22 June 2013 - 07:03 PM

Thank you for replying. I've already read the documentation about Custom Page Template. In my point of view, it's not complete. Referring to what you replies, you mean that if i want to display a custom post type listing i have just to go to Drag & Drop section and select my template and assign in content area the PostLoop section? The post loop is for post and not for custom post type ! isn't it ?

 

What about my question 2?

2. If a want to display a single job, which will be the name of template file : page.job.php ? how to do ?

 

thanks



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 22 June 2013 - 07:38 PM

I think you misunderstood.

 

1.  A custom post type isn't a special template, it is part of the post loop.  It is not something unique in PageLines, but is a special field or set of fields in WordPress.  Thus for a custom post type to display in PageLines, two things are critical.

 

A. You need to have Content (a section) present in the Page Templates in Drag & Drop.

B. You need to have PostLoop (a section) present in the Content Area for the corresponding template.

 

2.  The link I provided was to help you create a custom page template in response to your second question. If you have a plugin to create the custom post type or query in a template, then it is in the custom page template you can apply any customized display of your custom post types.

 

Your question asked "which will be the name of template file : page.job.php".  We cannot determine what page name is needed for your purposes.  I provided you the guidance explaining that you are free to name the custom page template as desired.  How a custom post type is applied depends largely on the way the custom post type is created.  Boxes, Feature Sliders, Banners are all custom post types and each has its own template. 

 

If you're using a plugin, the plugin itself should create the essential queries and post template, or provide the code you'll need. If it doesn't the plugin may not be well-suited to your needs.



#5 pracede

pracede

    Member

  • Members
  • 26 posts
  • Framework Version:Developper

Posted 24 June 2013 - 01:23 PM

I am always trying with the plugin classifieds. I'ave installed the plugin and something strange appears on the deafutl page listing all classifieds. I have on top the classfieds and juste after post containing classifieds generated by pagelines framework.  You can see the image here

Please Login or Register to see this Hidden Content

. Why this behaviour ? What to do in this page to not display content generated by pagelines ?

 

Thanks



#6 James B

James B

    Advocate

  • Moderators
  • 4979 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 24 June 2013 - 11:07 PM

Hi there, looking at the image it seems that the plugin is populating the information at the top of the page, the duplicate information seems to be coming from a post. Have you tried removing the postloop on that template? Does this leave the plugin content only?







Also tagged with one or more of these keywords: theming, child theme, custom post type