Question

If I put a file up in my theme folder named foo.php that only contains <h1>Foo</h2>, WordPress will automatically pull in the home.php file.

Is there any function to prevent that and have it simply render the file foo.php. I'll still want to be able to use the wordpress functions from that page.

Thanks!

Was it helpful?

Solution

<?php
/*
Template Name: Foo
*/
?>

<h2>Foo</h2>

Saved (obviously) as 'foo.php'.

Then, when you publish a page, through the dashboard using the 'Foo' template, that template will be used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top