Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created March 5, 2014 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whyisjake/9358868 to your computer and use it in GitHub Desktop.
Save whyisjake/9358868 to your computer and use it in GitHub Desktop.
Conditionally load a easy custom field.
<?php
if ( is_page_template( 'page-weekend-projects-2013.php' ) ) {
/**
* Add a meta box on the weekend projects page.
*/
$field_data = array (
'title_takeover' => array(
'fields' => array(
'first_row' => array(
'label' => 'First Row',
'hint' => 'Use this to create a custom shortened title.',
'type' => 'text',
),
'second_row' => array(
'label' => 'Second Row',
'hint' => 'Use this to create a custom shortened title.',
'type' => 'text',
),
),
'title' => 'Weekend Projects Sliders',
'context' => 'advanced',
'pages' => array( 'page' ),
),
);
$easy_cf = new Easy_CF( $field_data );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment