0

My client uses a theme called "Imbalance2", which hides the template option in dashboard "page attributes" section. Is there a way to assign a custom template to a page despite this - rather irritating - limitation imposed by the theme?

1
  • Am I missing something here? I thought the template option is displayed in the Admin panel under Appearance --> Themes. What is a "page attributes" section? I thought you can do whatever you want, either a custom page style option tool or easier yet using the wordpress theme customizer $wp_customize->add_setting(...
    – zipzit
    Commented Jan 28, 2014 at 21:06

2 Answers 2

1

It could have been disabled in the "screen options" dropdown at the top of the page.

But, if it hasn't, and you need to only affect one page, then you can use the naming convention of "page-(ID).php" or "page-(slug).php" outlined here, however this can cause frustration if you try to change a template after the fact, so please use with caution.

0

I do not see a reason why the theme would do such a thing. Why would a theme cut down on features.

To double check it, make sure the page attributes in the screen options is checked.

Apart from that you can always set a page template using code.

_wp_page_template is the meta key which stores the page template.

You can update the page template using update_post_meta

Like

$post_id = 'the id of the post/page';
$template = 'name of the template';    

update_post_meta( $post_id, '_wp_page_template', $template );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.