コード例 #1
0
 public function __construct()
 {
     $callback_prefix = apply_filters('baton_conductor_query_callback_prefix', 'baton_conductor_');
     // Callback function prefix
     // Populate defaults
     $this->defaults = array('disabled' => false, 'enhanced_display_disabled' => false, 'title' => __('Recent News', 'baton'), 'posts_per_page' => 13, 'enhanced_display_posts_per_page_offset' => $this->enhanced_display_offset, 'category' => 0, 'flexbox_columns' => 3, 'output' => array(10 => array('id' => 'featured_image', 'label' => __('Featured Image', 'baton'), 'type' => 'built-in', 'visible' => true, 'link' => true, 'callback' => $callback_prefix . 'featured_image'), 20 => array('id' => 'post_title', 'label' => __('Title', 'baton'), 'type' => 'post_title', 'visible' => true, 'link' => true, 'callback' => $callback_prefix . 'post_title'), 30 => array('id' => 'post_content', 'label' => __('Excerpt', 'baton'), 'type' => 'content', 'visible' => true, 'value' => 'excerpt', 'callback' => $callback_prefix . 'post_content'), 40 => array('id' => 'read_more', 'label' => baton_more_link_label(), 'type' => 'read_more', 'visible' => true, 'link' => true, 'callback' => $callback_prefix . 'read_more'), 50 => array('id' => 'author_byline', 'label' => __('Author Byline', 'baton'), 'type' => 'built-in', 'visible' => true, 'callback' => $callback_prefix . 'author_byline')), 'post_thumbnails_size' => '', 'excerpt_length' => apply_filters('excerpt_length', 55));
     // Load required assets
     $this->includes();
     // Setup the theme mod
     $this->setup_theme_mod();
     // Hooks
     add_action('pre_get_posts', array($this, 'pre_get_posts'));
     // Pre Get Posts
     add_action('wp', array($this, 'wp'), 20);
     // Populate theme mod value (after WordPress)
     add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'));
     // Enqueue scripts/styles
 }
コード例 #2
0
 /**
  * This function sets the default more link label in the Customizer.
  */
 public function theme_mod_baton_more_link_label($label = false)
 {
     // Return the current color if set
     if ($label) {
         return $label;
     }
     // Return the default
     return baton_more_link_label(true);
 }
コード例 #3
0
ファイル: class-baton.php プロジェクト: sdsweb/baton
 /**
  * This function adjusts the default setting values for Conductor widgets.
  */
 public function conductor_widget_defaults($defaults, $widget)
 {
     // If Conductor has flexbox display
     if ($this->conductor_has_flexbox_display($widget)) {
         // Adjust default widget size (display) to flexbox
         $defaults['widget_size'] = 'flexbox';
     }
     $author_byline = array();
     // Loop through output elements
     foreach ($defaults['output'] as $priority => $output) {
         // Read More
         if ($output['id'] === 'read_more') {
             // Adjust default label to match Baton more link label
             $defaults['output'][$priority]['label'] = baton_more_link_label();
         }
         // Author Byline (store reference to priority and configuration)
         if ($output['id'] === 'author_byline') {
             $author_byline = $output;
             // Remove author byline
             unset($defaults['output'][$priority]);
         }
     }
     // Read More output features (Baton deault)
     $defaults['output_features']['read_more']['edit_label']['default'] = _x('Continue Reading', '"read more" label for Conductor widgets', 'baton');
     /*
      * Author Byline (move to bottom of default output elements)
      */
     $output_elements = array();
     $default_priority_gap = 10;
     $count = 0;
     // Loop through the passed in widget settings
     foreach ($defaults['output'] as $output) {
         // Increase count
         $count++;
         // Add this element to the output elements
         $output_elements[$default_priority_gap * $count] = $output;
     }
     // Author Byline (increase count before multiplying)
     $output_elements[$default_priority_gap * ++$count] = $author_byline;
     // Set the default output
     $defaults['output'] = $output_elements;
     return $defaults;
 }
コード例 #4
0
ファイル: loop-search.php プロジェクト: sdsweb/baton
        if (has_excerpt()) {
            the_excerpt();
            ?>
						<div class="clear"></div>

						<a href="<?php 
            the_permalink();
            ?>
" class="button more-link"><?php 
            echo baton_more_link_label();
            ?>
</a>
					<?php 
            // Otherwise show the content
        } else {
            the_content(baton_more_link_label());
        }
        ?>
			</div>
			<!-- End Article Content -->

			<div class="clear"></div>

			<!-- Post Meta -->
			<div class="article-post-meta article-post-meta-archive baton-flex baton-flex-3-columns baton-flex-post-meta-archive">
				<?php 
        sds_post_meta(true);
        ?>
			</div>
			<!-- End Post Meta -->