Searching...
Wednesday 19 October 2016

Creating Custom Page Templates in WordPress



HTML page and our original template and put the source code we could see that it had two columns one was a primary column another was a secondary column the primary calling was displaying the content here in the right and secondary was displaying the sidebar on the left what we're going to do this video is look at how to create an additional custom template option for pages to that rather than just having the flu with option like we have here we can display it using a two column layout as we do here to do that will open up the blog source code and just like we did before I bring it over to one side so that we could do our code on the other our page. PHP file we want to know this is what we're going to do now though it's a bit of pain - sidebar left yes ma'am and Convention is not required however it's a good one and that whenever you create a custom page template that you need it with Paige at the beginning and then - whatever type of page that is the reason for this is that it will then keep all your page templates organized in the same area rather than just telling this side bar - left it gets lost this is actually a page template at the top we can open up a PHP blog and at a special comment card template name and close it this structure here having a comment at the top of template name and then calling the name is what tells WordPress that this is our custom template we can now begin to take what we need from a 2-pound Blog template and bring it over into our side bar page what would do his will come down and see that we have a section opening up after the header that comes all the way down into primary class so will delete but we have currently replace it with this new code lineup for the primary class open come down to find the closing of that primary class so I'm right there and then we could see that the second column is open to bring that in over and test your setup here make sure that everything's open and close properly so if we had this primary date roses next time two men next movies and you can see the dentist tomorrow so that closes out and then this has a special h2 tag with the class module heading in it that will go inside of our secondary calling and we're just going to label that says sidebar to let me know in the future we could go and add a widget area there but this should be good YouTube

0 comments:

Post a Comment