Archived

This topic is now archived and is closed to further replies.

  • 0

Questions about Theming and custom post type


Question

Posted · Report post

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 http://support.pagelines.me/docs/customization/create-a-custom-page-template/ 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 http://paste.pagelines.com/17g . My question is where i can find this template file because there are not in my child base theme ? You can see http://paste.pagelines.com/7x7 .

 

Thanks

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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: http://support.pagelines.me/docs/customization/create-a-custom-page-template/

 

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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 http://paste.pagelines.com/7xb . Why this behaviour ? What to do in this page to not display content generated by pagelines ?

 

Thanks

Share this post


Link to post
Share on other sites