ThemeForest

a little help with some code?

751 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United States
CyberShot says

I am working on adding a custom meta box to a page. I got it displaying fine. My problem is that I only want the meta box to display on a particular page which just happens to be a template. I tried is_page_template() and is_page but everytime I add the conditional, the meta box doesn’t show. I am doing it like so

if( is_page('home')){
 add_meta_box( 'locationFinder', 'Location Finder', 'cd_meta_box_cb', 'page', 'normal', 'high' ); 
}

Neither function in the if statement is working. Any ideas?

by
by
by
by
by