Is there any way to add a few meta boxes to say just the homepage which in my case has a custom theme page template of home-page.php
I realize I could do this as a theme option and simply create a new option section called “Home page” and create the fields there, but I think it makes more sense from a usability perspective to place the meta boxes for the callout boxes on the homepage actually on the Home page WP edit screen.
Yes, it’s easy to do that.
– Create a template for home page (ex: home-page.php).
– Create an OptionTree Custom Metabox (see document) for Home page. Before the line of PHP code that register OptionTree Custom Metabox you add some line of code to check if editing page has template name is home-page.php then register metabox otherwise bypass register code. In WP page edit screen choose your homepage template in template select box and save page. Your metabox for home page will show.
@franciscoamk and @htvu are correct. Currently the code base does not support this feature and you’ll need to do one of the two option listed above. Hopefully in the future I’ll figure out an elegant way to do this, but I’ve not come up with one yet.
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘[Resolved] Meta Boxes on specific theme template page’ is closed to new replies.