/**
  * Prints the inner fields for the custom post/page section
  *
  * @global mixed $post
  */
 function pt_inner_custom_box()
 {
     global $post;
     // Use nonce for verification
     echo '<input type="hidden" name="pt_noncename" id="pt_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
     // The actual fields for data entry
     echo '<label class="hidden" for="post_template">' . __('Post Template', 'genesis') . '</label><br />';
     echo '<select name="_wp_post_template" id="post_template" class="dropdown">';
     echo '<option value="">' . __('Default', 'genesis') . '</option>';
     post_templates_dropdown();
     //get the options
     echo '</select><br /><br />';
     echo '<p>' . __('Some themes have custom templates you can use for single posts that might have additional features or custom layouts. If so, you will see them above.', 'genesis') . '</p><br />';
 }
Example #2
0
    /**
     * Echoes single post template metabox contents.
     *
     * Uses nonce for verification.
     *
     * @since 0.2.0
     *
     * @uses post_templates_dropdown() Create dropdown options
     *
     * @see pt_add_custom_box()
     *
     * @global stdClass $post Post object
     */
    function pt_inner_custom_box()
    {
        global $post;
        ?>
	<input type="hidden" name="pt_noncename" id="pt_noncename" value="<?php 
        echo wp_create_nonce(plugin_basename(__FILE__));
        ?>
" />

	<label class="hidden" for="post_template"><?php 
        _e('Post Template', 'genesis');
        ?>
</label><br />
	<select name="_wp_post_template" id="post_template" class="dropdown">
		<option value=""><?php 
        _e('Default', 'genesis');
        ?>
</option>
		<?php 
        post_templates_dropdown();
        ?>
	</select><br /><br />
	<p><?php 
        _e('Some themes have custom templates you can use for single posts that might have additional features or custom layouts. If so, you will see them above.', 'genesis');
        ?>
</p>
	<?php 
    }
Example #3
0
/**
 * Contents for the Layout Options metabox
 *
 * Allows user to choose:
 * - the post template used by the post, if the current post is not a page
 * - the sidebar used by this post
 *
 * @global $post
 */
function largo_layout_meta_box_display()
{
    global $post;
    wp_nonce_field('largo_meta_box_nonce', 'meta_box_nonce');
    $current_template = of_get_option('single_template') == 'normal' ? __('One Column (Standard)', 'largo') : __('Two Column (Classic)', 'largo');
    if ($post->post_type != 'page') {
        echo '<p><strong>' . __('Template', 'largo') . '</strong></p>';
        echo '<p>' . __('Select the post template you wish this post to use.', 'largo') . '</p>';
        echo '<label class="hidden" for="post_template">' . __("Post Template", 'largo') . '</label>';
        echo '<select name="_wp_post_template" id="post_template" class="dropdown">';
        echo '<option value="">' . sprintf(__('Default: %s', 'largo'), $current_template) . '</option>';
        post_templates_dropdown();
        //get the options
        echo '</select>';
        echo '<p>' . sprintf(__('<a href="%s">Click here</a> to change the default post template.', 'largo'), admin_url('themes.php?page=options-framework#of-option-layoutoptions41'));
        echo '</p>';
    }
    echo '<p><strong>' . __('Custom Sidebar', 'largo') . '</strong><br />';
    echo __('Select a custom sidebar to display.', 'largo') . '</p>';
    echo '<label class="hidden" for="custom_sidebar">' . __("Custom Sidebar", 'largo') . '</label>';
    echo '<select name="custom_sidebar" id="custom_sidebar" class="dropdown">';
    largo_custom_sidebars_dropdown();
    //get the options
    echo '</select>';
}