Simlified function, maybe will help someone:
jQuery(document).ready(function($) {
$("#page_template").change(function() {
if($('#page_template').val() != 'page-contacts.php') {
// show the meta box
$('#postdivrich').show();
} else {
// hide your meta box
$('#postdivrich').hide();
}
}).change();
});
Of course it lacks controls what fields will be submitted, because jQuery just hides them. As I am coding it for one-admin user it is not big deal, helps to get cleaner layout. But in other cases it might be dangerous.
Related Posts:
- Page template no longer exists – metaboxes won’t save
- Custom templates not showing up in template dropdown
- Get page id by template
- Change page template programmatically ?
- Listing pages which uses specific template [duplicate]
- Is there a way to change the default page template selection?
- Hide page visual editor if certain template is selected?
- Creating a template using a specific slug name, for a page with a parent page
- How to add or remove metabox each page separately?
- Limit number of pages that use a specific template?
- Hide page visual editor if template is selected – redux
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- Page template gives ‘Parse error: syntax error’ when used, but no error found!
- more tag in the $post->content when get_pages were used
- Why is custom template not seen as page with is_page()?
- Page with page template not using template in Preview
- WordPress 4 and wp_editor() Not Showing Visual/Text tabs
- Get Order of Meta Box in a Page/Post
- Template for child pages / subpages
- How to dynamically save a selected option from page “Templates” selectbox?
- Include a specific page in your template
- How to add meta boxes to Pages
- Custom page template not working
- How do I create a separate page for each author?
- How to create a metabox that will list all my pages in a dropdown selector?
- Where is the key _wp_page_template passed?
- How do I pass data from page content to the underlying PHP template
- How do i change page template in bulk?
- Load specific page template based on URI
- I have index.php and other files, how do I display other pages?
- is_home() returns TRUE on page template
- Using Pages to handle calls for custom post types
- How to make tag post listing page working?
- Custom page template with entirely different design. Is it possible in?
- How to make my category archive behave like a page
- page-name.php doesn’t execute on custom template
- Remove Content edit box from ALL pages (not posts)
- Edit Parent page drop menu when creating a page
- Is it possible to activate page template without manually selecting it in wp-admin?
- Hide page templates without using ‘unset’
- the_content of template page
- Use same page-mypage.php template for several pages
- pre-existing data, and entities
- Rewrite to load homepage for a different url
- Avoid pages losing template association on site re-deploy
- Need to create a custom page on a website
- List child pages within page template
- Using page-something.php as static front page
- Undefined index: post in NOTICE while adding meta box
- Best way to organize data in this scenario
- creating single page with 2 columns while theme is 3 column
- Using index.php as page template
- How does wordpress link page templates to individual pages
- Set parent page based on custom metabox value
- Create custom page to author.php
- Translate dashboard metabox
- Template field missing in page attributes
- Different template parts when on different pages
- Updating page template pragmatically
- WordPress blog posts template bug [closed]
- Adding styles/scripts to specific page
- WordPress form submit to custom page template does not work
- Display grandchild page content on parent page
- How do you assign custom template for Posts page (under Front page displays setting)
- display different pages content on single page
- Custom Upload Adds Ghost File
- How to output different content of page on different places in my template
- Avada Theme – Display results from a specific category [closed]
- Multiple pages to show posts
- How to finish this loop?
- Auto-Create Pages from Template Directory
- Loading custom jQuery and HTML in a WordPress page
- different single.php for different page templates
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- How to add or remove metabox each page separately?
- Naming custom page templates
- How can I use Page editor for two separate templates?
- Display random page
- How to read a page’s “Shortcodes” from the Template File?
- if and else statement not working on the iframe php page
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Custom template is not showing up in templates dropdown list after re-naming it
- May I know where to edit the tax rate?
- how to print the content of pages inside the front end area
- All the pages are blank [closed]
- Filter posts by author selected in page
- WordPress, page 2 shows the same posts as page 1
- Temporary download page or restrict static download page based on how the user got to the page?
- Fake Single WordPress Post (Page) Loop
- How do I make just one of my pages a Blog Page?
- Get ID of the page where shortcode is included
- Standard way of creating profile pages with custom content for each user?
- How to show parent pages on a specific page if user is logged in?
- Hide if subpages are shown
- How to achieve anchor links on top of pages.
- Dynamic content in pages
- Can’t select a page using is_page()
- Custom single page based on which custom page template is selected
- displaying child pages in columns when on a parent page