The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

WordPress code help

  • # January 31, 2012 at 3:46 am

    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' );

    I have tried the name of my page template, the title of the page both upper and lower case. Nothing seems to be working. Anyone got any idea?

    # January 31, 2012 at 4:16 am

    Have a read of the following article

    # January 31, 2012 at 11:27 pm

    This reply has been reported for inappropriate content.

    thanks for the link SgtLegend. That did the trick.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed