Skip to content
Menu
i do, therefore i am
  • Home
  • Blog
  • Contact us
i do, therefore i am
November 26, 2022

A WordPress theme from scratch 5

Custom pages and page templates.

After inserting content and defining default and custom css-classes for the different pages, we are going to work on how to provide different pages with each its own structure and content.

Custom page templates

Creating a custom page template is a simple matter. It requires creating a .php file with a name following the structure:

page-<page-slug|page-id>.php

This means, of course, that we will need to know either the ID or the so-called slug of the page. The slug of the page can be obtained by looking at it’s URL: it is the part following the slash (/). To get the ID of the page, we need to open the page in the page editor and examine the URL there. The number following the ?post= part of the URL is the page ID.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • vim as Hex-Editor
  • installing pico-sdk in wsl
  • A WordPress theme from scratch 5
  • A WordPress theme from scratch 4
  • Serial Port Windows

Recent Comments

    Archives

    • May 2023
    • January 2023
    • November 2022
    • October 2022
    • September 2022
    • May 2022
    • April 2022
    • March 2022
    • February 2022
    • January 2021

    Categories

    • Fortran
    • linux
    • Postgresql
    • Programming
    • Python
    • Tools, tips and tricks
    • Wordpress

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Postgres

    • postgres-docs

    Python

    • data model
    • the standard library
    • python tips
    • import system
    • asyncio
    • built-in functions

    Open_VMS

    • lexicals at marc’s place
    • documentation and manuals
    • system services
    • rms services reference
    ©2025 i do, therefore i am | Powered by WordPress and Superb Themes!