Archived

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

  • 0

How to structure a custom template

Question

Posted · Report post

I've read the docs about adding a custom template, like page.homepage.php but I still have no idea how to add content to that template. I've looked inside the folders of the pagelines directory to find a example of the structure used by PL for building a single post template or a category template. Where are they?

 

For the rest I asume that whatever I place underneath setup_pagelines_template(); will be the part between the head and footer?

 

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

Hi,

 

It is not possible to build a Post template or a Category template, as these pages are considered special by Wordpress. The custom page template is for creating a custom page template that can be used in PageLines > Drag and Drop, where you also have Template | Default, Template | 1, Template | 2,  Template | 3 etc...

 

To add content to your template such as sections etc... go to PageLines > Drag and Drop and select your custom template, which if created correctly, should now appear in the templates list.

 

Then you go to Wordpress > Pages, add/edit a page and then in the template drop down menu on the right hand side, select your template.

Share this post


Link to post
Share on other sites

Posted · Report post

So adding a custom template is nothing more than adding numerous extra templates to be able to construct using the drag and drop section?

I thought is was an option to build a template completely by hand if that was needed.

Share this post


Link to post
Share on other sites

Posted · Report post

Why would you want to create a page template by hand ?

 

If however, you're referring to adding your own content then the best course of action would be to build your own sections.

Share this post


Link to post
Share on other sites

Posted · Report post

Until now I've been building my WP sites 'by hand', so perhaps I'm still too much used to that ;) I will read a bit more about sections and hooks.

Anyway, what I said, was that correct?: 'So adding a custom template is nothing more than adding numerous extra templates to be able to construct using the drag and drop section?'

Share this post


Link to post
Share on other sites

Posted · Report post

Yes, if you create a custom page template, it is basically another template which you can use in drag and drop.

Share this post


Link to post
Share on other sites