[vc_row][vc_column][vc_column_text]

Custom Page Templates

  • To create a new template for pages
  • Go into the theme folder of twenty-fifteen( found under wp-content/themes/twentyfifteen )
  • Create a copy of the file called page.php, and name it
  • Open it up with your favorite text editor

It should look something like this:

    • The first thing you want to do is add the following at the top of the code. Right below the PHP opening tag ( <?php )

    • So the commented area should look something like this:

  • With the code above added to the top of the code as a PHP comment
  • The template system of WordPress now recognizes this as a custom page template.
  • Go to your admin dashboard_add new/edit page section
  • You will see a new dropdown appear in the Page Attributes meta box on the right side
  • Now make the edits to the page template
  • You can edit anything in the code, as long as you have the Template Name: Roundup in the header

Custom Post Templates

  • It’s almost the same process, but you’ll need a plugin to work
  • There are two popular plugins, Custom Post Template and Single Post Template

With Custom Post Template Plugin

    • First, install it
    • Go to the page.php file and look for single.php
    • As we did for the page templates, make a copy of it, and name it
    • Open it with your favorite text editor
    • Should looks something like this:

    • Then add the following at the top. As  PHP comment.

    • After you added the php comment and installed the plugin, on the post editor, you should see a new meta box appear, titled “Post Template

    • With Single Post Template Plugin
    • Difference is the PHP Comment you have to add on the top

    • This one, adds the meta box under the editor, and not on the sides
    • Works the same as all the above

  • You can edit anything, add/remove anything
  • If you want to perform queries, you have to have either WP_Head() or wp_header() in your file

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text][Echo_Backend_SC post_id=”6646″][/vc_column_text][/vc_column][/vc_row]

jass

Share
Published by
jass

Recent Posts

Google Chrome Developer Tools (DevTools)

🔍 How to Open DevTools You can open DevTools in several ways: Right-click on any…

4 days ago

Why Ignoring the Model Context Protocol (MCP) Could Cripple California’s AI Future

Model Context Protocol (MCP) is revolutionizing how AI applications connect with external tools, APIs, and…

5 days ago

Funding opportunity through Small Business Innovation Research (SBIR) for New/Small Businesses

The Small Business Innovation Research (SBIR) program offers a vital pathway for startups to secure…

2 weeks ago

California Dreaming: 10 Business Ideas with Case Studies and SWOT Analysis

Looking to start a business in California? This guide explores 10 high-potential business ideas—from real…

2 weeks ago

USA resources

UNited States https://www.glassdoor.co.in/Overview/Working-at-Prefr-co-EI_IE7010540.11,19.htm https://www.ambitionbox.com/overview/prefr-dot-co-overview https://rocketreach.co/prefrco-management_b7c95a7ec0ee0ee2 https://www.signalhire.com/companies/prefr-co https://www.zoominfo.com/c/prefrco/557658591 United Kingdom https://www.yellowtom.co.uk/reviews/1417493 Canada https://www.pandia.com/ca/oshawa-on/graphic-design Singapore https://talenttribe.asia/companies/prefr-co India…

2 weeks ago

Blockchain Engineer

We are seeking a skilled and motivated Blockchain Engineer to join our team. In this…

2 weeks ago