Ejemplo n.º 1
0
 function __construct()
 {
     global $ss_settings;
     if (!class_exists('BuddyPress') || class_exists('BuddyPress') && !shoestrap_is_bp()) {
         add_action('shoestrap_entry_meta', array($this, 'meta_custom_render'));
     }
     add_filter('excerpt_more', array($this, 'excerpt_more'));
     add_action('wp', array($this, 'remove_featured_image_per_post_type'));
     // Add featured images
     if (!is_singular()) {
         add_action('shoestrap_entry_meta', array($this, 'featured_image'));
     }
     // Chamnge the excerpt length
     if (isset($ss_settings['post_excerpt_length'])) {
         add_filter('excerpt_length', array($this, 'excerpt_length'));
     }
     // Show full content instead of excerpt
     if (isset($ss_settings['blog_post_mode']) && 'full' == $ss_settings['blog_post_mode']) {
         add_filter('shoestrap_do_the_excerpt', 'get_the_content');
         add_filter('shoestrap_do_the_excerpt', 'do_shortcode', 99);
         add_action('shoestrap_entry_footer', array($this, 'archives_full_footer'));
     }
     // Hide post meta data in footer of single posts
     if (isset($ss_settings['single_meta']) && $ss_settings['single_meta'] == 0) {
         add_filter('shoestrap_the_tags', '__return_null');
         add_filter('shoestrap_the_cats', '__return_null');
     }
 }
 function __construct()
 {
     global $ss_settings;
     // When on a BuddyPress, disable social shares.
     if (class_exists('BuddyPress') && shoestrap_is_bp()) {
         $ss_settings['social_sharing_single_post'] = 0;
         $ss_settings['social_sharing_single_page'] = 0;
         $ss_settings['social_sharing_archives'] = 0;
     }
     $social_sharing_location = isset($ss_settings['social_sharing_location']) ? $ss_settings['social_sharing_location'] : null;
     // Social Share select
     $social_sharing_single_page = isset($ss_settings['social_sharing_single_page']) ? $ss_settings['social_sharing_single_page'] : null;
     // Conditions for showing content in posts archives
     if (isset($ss_settings['social_sharing_archives']) && $ss_settings['social_sharing_archives'] == 1) {
         add_action('shoestrap_entry_footer', array($this, 'social_sharing'), 5);
     }
     // Conditions for showing content in single posts
     if (isset($ss_settings['social_sharing_single_post']) && $ss_settings['social_sharing_single_post'] == 1) {
         if ($ss_settings['social_sharing_location'] == 'top') {
             add_action('shoestrap_single_pre_content', array($this, 'social_sharing'), 5);
         } elseif ($ss_settings['social_sharing_location'] == 'bottom') {
             add_action('shoestrap_single_after_content', array($this, 'social_sharing'), 5);
         } elseif ($ss_settings['social_sharing_location'] == 'both') {
             add_action('shoestrap_single_pre_content', array($this, 'social_sharing'), 5);
             add_action('shoestrap_single_after_content', array($this, 'social_sharing'), 5);
         }
     }
     // Conditions for showing content in single pages
     if (isset($ss_settings['social_sharing_single_page']) && $ss_settings['social_sharing_single_page'] == 1) {
         if ($ss_settings['social_sharing_location'] == 'top') {
             add_action('shoestrap_page_pre_content', array($this, 'social_sharing'), 5);
         } elseif ($ss_settings['social_sharing_location'] == 'bottom') {
             add_action('shoestrap_page_after_content', array($this, 'social_sharing'), 5);
         } elseif ($ss_settings['social_sharing_location'] == 'both') {
             add_action('shoestrap_page_pre_content', array($this, 'social_sharing'), 5);
             add_action('shoestrap_page_after_content', array($this, 'social_sharing'), 5);
         }
     }
 }