Exemplo n.º 1
0
    function display_add_new_field($taxonomy)
    {
        ?>
		<div class="form-field">
			<label for="custom_sidebar"><?php 
        _e('Archive Sidebar', 'largo');
        ?>
</label>
			<select name="custom_sidebar" id="custom_sidebar" style="min-width: 300px;">
				<?php 
        largo_custom_sidebars_dropdown('', false, 0);
        //get the options
        ?>
			</select>
			<p class="description"><?php 
        _e('The sidebar to show on this term\'s archive.', 'largo');
        ?>
</p>
			<?php 
        wp_nonce_field('custom_sidebar-new', '_custom_sidebar_nonce');
        ?>
		</div>
		<?php 
    }
Exemplo n.º 2
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>';
}
Exemplo n.º 3
0
function cftl_tax_landing_main($post)
{
    wp_nonce_field(plugin_basename(__FILE__), 'cftl_tax_landing_main');
    $fields = $post->post_title ? get_post_custom($post->ID) : cftl_field_defaults();
    $fields['show'] = maybe_unserialize($fields['show'][0]);
    foreach (array('image', 'excerpt', 'byline', 'tags') as $key) {
        if (!array_key_exists($key, $fields['show'])) {
            $fields['show'][$key] = 0;
        }
    }
    ?>
<div class="form-field-radios">
	<h4>Layout</h4>
	<div class="options">
		<div>
			<input type="radio" name="cftl_layout" id="layout_two_column" value="two-column" <?php 
    checked($fields['cftl_layout'][0], 'two-column');
    ?>
 />
			<label for="layout_two_column" class="cols" id="two-col">Two Column</label>
		</div>
		<div>
			<input type="radio" name="cftl_layout" id="layout_three_column" value="three-column" <?php 
    checked($fields['cftl_layout'][0], 'three-column');
    ?>
 />
			<label for="layout_three_column" class="cols" id="three-col">Three Column</label>
		</div>
		<div>
			<input type="radio" name="cftl_layout" id="layout_one_column" value="one-column" <?php 
    checked($fields['cftl_layout'][0], 'one-column');
    ?>
 />
			<label for="layout_one_column" class="cols" id="one-col">One Column</label>
		</div>
		<div id="explainer" class="<?php 
    echo $fields['cftl_layout'][0];
    ?>
">
			<span class="one-column">No regions: posts take up full width </span>
			<span class="two-column">One widget region on right</span>
			<span class="three-column">Two widget regions, skinny on left and normal on right</span>
		</div>
		<div id="left-region" class="regioner">
			<strong>Lefthand Column Widget Region</strong><br/>
			<select name="left_region">
			<?php 
    largo_custom_sidebars_dropdown($fields['left_region'][0], TRUE);
    ?>
			</select>
		</div>
		<div id="right-region" class="regioner">
			<strong>Righthand Column Widget Region</strong><br/>
			<select name="right_region">
			<?php 
    largo_custom_sidebars_dropdown($fields['right_region'][0], TRUE);
    ?>
			</select>
		</div>
	</div>
</div>
<div class="form-field-select">
	<h4>Posts Per Page</h4>
	<div>
		<select name="per_page">
			<?php 
    $options = array("5", "10", "15", "20", "30", "all");
    foreach ($options as $opt) {
        echo '<option value="', $opt, '"', selected($fields['per_page'][0], $opt), '>', $opt, "</option>\n";
    }
    ?>
		</select>
	</div>
</div>
<div class="form-field-select">
	<h4>Post Order</h4>
	<div>
		<?php 
    //allow 'custom' if we have a single term
    $terms = get_the_terms($post->ID, 'series');
    if (count($terms) == 1) {
        $series_id = $terms[0]->term_taxonomy_id;
    }
    ?>
		<select name="post_order">
			<?php 
    $options = array("Newest first" => 'DESC', "Oldest first" => 'ASC', "Featured, then newest first" => 'featured, DESC', "Featured, then oldest first" => 'featured, ASC');
    if ($series_id) {
        $options["Custom"] = "custom";
    }
    foreach ($options as $label => $opt) {
        echo '<option value="', $opt, '"', selected($fields['post_order'][0], $opt), '>', $label, "</option>\n";
    }
    ?>
		</select>
		<?php 
    if ($series_id) {
        add_thickbox();
        ?>
		<a class="thickbox custom" href="#TB_inline?width=600&height=550&inlineId=custom-order">Manage</a>
		<div id="custom-order">
			<div>
				<div id="post-list">
					<p><?php 
        _e('Drag and drop to reorder posts. Newly-added posts will appear at the bottom', 'largo');
        ?>
</p>
					<ul id="postsort" data-series-id="<?php 
        echo $series_id;
        ?>
">
						<?php 
        cftl_load_posts($series_id);
        ?>
					</ul>
					<div class="publishing">
						<input type="submit" name="cancel" value="<?php 
        esc_attr_e('Cancel', 'largo');
        ?>
" class="button" />
						<input type="submit" class="button-primary" id="save-order" value="<?php 
        esc_attr_e('Save & Close', 'largo');
        ?>
" />
					</div>
				</div>
			</div>
		</div>
		<?php 
    }
    ?>
	</div>
</div>
<div class="form-field-checkboxes">
	<h4>Show</h4>
	<div>
		<label for="show-image">
			<input type="checkbox" id="show-image" name="show[image]" value="1" <?php 
    checked($fields['show']['image'], 1);
    ?>
 /> Featured Image
		</label>
		<label for="show-date">
			<input type="checkbox" id="show-excerpt" name="show[excerpt]" value="1" <?php 
    checked($fields['show']['excerpt'], 1);
    ?>
 /> Excerpt
		</label>
		<label for="show-byline">
			<input type="checkbox" id="show-byline" name="show[byline]" value="1" <?php 
    checked($fields['show']['byline'], 1);
    ?>
 /> Byline
		</label>
		<label for="show-tags">
			<input type="checkbox" id="show-tags" name="show[tags]" value="1" <?php 
    checked($fields['show']['tags'], 1);
    ?>
 /> Categories/Tags
		</label>
	</div>
</div>
<?php 
}