Change CSS/formatting on specific page, but not pages in general?

Posted by Prem Tiwari | Updated on

After creating the specific CSS you need to format the page how you like, you could:

  1. Create a custom page template with the CSS and assign the template this page.
  2. Create a page-{slug}.php file with the CSS, where {slug} is the page slug for this page (most likely the filename should be page-voronoi-temperature-map.php).
  3. Create a page-{ID}.php file, where if the page ID is 6, WordPress will look to use page-6.php.

These three options were mentioned in the Codex, under Template Hierarchy. By using any of these 3 options, you can alter the layout for this page without affecting all the rest of your pages.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers