WordPress is really a great CMS(Content Management System). Its simplicity reflect all around in terms of its architecture,naming convention or admin panel.So here i am gonna discuss about uses of WordPress Template.Dealing points will be:-
- Templates and Its advantage
- Creation of Sample Template
- Edit any template from your Dashboard
- Templates and Its Advantage
- Creation of Sample Template :
- Edit any template from your Dashboard :
To create any Custom Template for your WordPress Site, you have to follow basic structure.Steps of doing that are given below:-
1. Create a file say “My_Template.php” under your current activated theme.
2. Code would be written like this:-
3. Go to Your Dashboard,then Click on Pages > All Pages.
4. Now you can see list of pages.Click on desire page and it will open editable form for that page.
5. Now look at your bottom-right section where you can see “Page attribute Section“,under which you can find “Template Assign” Section.
6. Just assign your custom template from drop-down to that page and save page.
Now Your Template is ready to use but one question would be raised in your mind that how those html code can be manageable.Since your template is being created by your contracted developer(freelancer).As a blog owner,how can you edit content for future prospects. Now to create dynamic template content,you have to write few code more.Its very easy and interesting features provided by WordPress team.You have to go through “Query Post” uses.
Now in order to make your content dynamic in your custom template,you have to perform certain steps:-
1. Write your html content structure(such as <div>,<span> and <img>) into any newly created post.
2. Now get its id from that posts URL:-
3. Now in your template write your code like this:-
This is a basic template creation.You can do lots of stuff into this.You have to figure it out by your self after exploring “Query Post” function in WordPress.