Use Landing Page Template On Single Posts

If you’re a true believer in landing pages, you might like to try using your landing page template on some of your single posts.

The only problem is, there’s no Page Attributes box on the Edit screen of single posts so you can’t select it.

1. You could install a plugin which adds the Page Attributes meta box and then modify your page_landing.php file to work on posts.

Or

2. You can simply add a custom function in your child theme which is far more flexible.

Here’s an example of what the 2nd solution produces:

Use Landing Page on Single Posts

Here’s the code you can paste at the end of your child themes functions file and modify.

The above code also removes the comment form. To remove any footer entry meta for category tags or author box you can use CSS if your theme doesn’t include hooks for these.

Genesis Users

You can use the code above or this code below which also removes the author box and entry meta from the footer.

Notes

  1. Both code snippets enable you to change the file name of your page template to match your own meaning you can also you use this code for any page template.
  2. Includes an array with a post I.D and post slug meaning you can add more single posts to the array separated by comma’s.
  3. Conditional tag can be changed as well.
  4. Tested on the Executive Pro theme by StudioPress

Related Posts

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.