Esempio n. 1
0
 function ishyoboy_metadata_seo_keywords()
 {
     global $post;
     if ($post && !ishyoboy_seo_plugin_active()) {
         if ($seo_keywords = IshYoMetaBox::get('ishyoboy_seo_keywords')) {
             echo '<meta name="keywords" content="' . esc_html(strip_tags($seo_keywords)) . '" />' . "\n";
         }
     }
 }
Esempio n. 2
0
 function ishyoboy_shortcode_portfolio_images($atts, $content = null)
 {
     $sc_atts = shortcode_atts(array('id' => '', 'css_class' => '', 'style' => '', 'tooltip' => '', 'tooltip_color' => '', 'slideshow' => 'yes', 'autoslide' => '', 'animation' => '', 'interval' => '', 'navigation' => '', 'thumbnail_size' => 'theme-large'), $atts);
     $return = '';
     $image_size = 'theme-large';
     if ($sc_atts['thumbnail_size'] != '') {
         $image_size = $sc_atts['thumbnail_size'];
     }
     $id = get_the_ID();
     $wp_3_5 = function_exists('wp_enqueue_media');
     if ($wp_3_5) {
         $images = array_filter(explode(',', IshYoMetaBox::get('ishyoboy_porfolio_images', true, $id)));
     } else {
         $images = get_children(array('post_parent' => $id, 'post_type' => 'attachment', 'numberposts' => -1, 'post_mime_type' => 'image'));
     }
     if ($images) {
         if ('yes' == $sc_atts['slideshow']) {
             wp_enqueue_script('imagesloaded');
             wp_enqueue_script('flexslider');
             //wp_enqueue_script( 'isotope' );
             $return .= '[slidable';
             $return .= '' != $sc_atts['id'] ? ' id="' . esc_attr($sc_atts['id']) . '"' : '';
             $return .= '' != $sc_atts['css_class'] ? ' class="portfolio_images_slideshow ' . esc_attr($sc_atts['css_class']) . '"' : ' class="portfolio_images_slideshow"';
             $return .= '' != $sc_atts['style'] ? ' style="' . esc_attr($sc_atts['style']) . '"' : '';
             $return .= '' != $sc_atts['tooltip'] ? ' tooltip="' . esc_attr($sc_atts['tooltip']) . '"' : '';
             $return .= '' != $sc_atts['tooltip_color'] ? ' tooltip_color="' . esc_attr($sc_atts['tooltip_color']) . '"' : '';
             $return .= '' != $sc_atts['autoslide'] ? ' autoslide="' . esc_attr($sc_atts['autoslide']) . '"' : '';
             $return .= '' != $sc_atts['animation'] ? ' animation="' . esc_attr($sc_atts['animation']) . '"' : '';
             $return .= '' != $sc_atts['interval'] ? ' interval="' . esc_attr($sc_atts['interval']) . '"' : '';
             $return .= '' != $sc_atts['navigation'] ? ' navigation="' . esc_attr($sc_atts['navigation']) . '"' : '';
             //$return .= ('' != $sc_atts['sameheight']) ? ' sameheight="' . esc_attr($sc_atts['sameheight']) .'"' : '' ;
             $return .= ']';
             if ($wp_3_5) {
                 if ($images) {
                     foreach ($images as $attachment_id) {
                         $return .= '[slide class="portfolio_slide"]';
                         $return .= '<a href="' . wp_get_attachment_url($attachment_id) . '" rel="portfolio-gallery-' . $id . '" class="openfancybox-image">';
                         $return .= wp_get_attachment_image($attachment_id, $image_size);
                         $return .= '</a>';
                         $return .= '[/slide]';
                     }
                 }
             } else {
                 foreach ($images as $image) {
                     $return .= '[slide class="portfolio_slide"]';
                     $return .= '<a href="' . wp_get_attachment_url($image->ID) . '" rel="portfolio-gallery-' . $id . '" class="openfancybox-image">';
                     $return .= wp_get_attachment_image($image->ID, $image_size);
                     $return .= '</a>';
                     $return .= '[/slide]';
                 }
             }
             $return .= '[/slidable]';
         } else {
             $return .= '<div class="portfolio_images';
             $return .= '' != $sc_atts['css_class'] ? ' ' . esc_attr($sc_atts['css_class']) : '';
             $return .= '' != $sc_atts['tooltip'] && '' != $sc_atts['tooltip_color'] ? ' tooltip-' . esc_attr($sc_atts['tooltip_color']) : '';
             $return .= '"';
             $return .= '' != $sc_atts['id'] ? ' id="' . esc_attr($sc_atts['id']) . '"' : '';
             $return .= '' != $sc_atts['style'] ? ' style="' . esc_attr($sc_atts['style']) . '"' : '';
             $return .= '' != $sc_atts['tooltip'] ? ' data-type="tooltip" title="' . esc_attr($sc_atts['tooltip']) . '"' : '';
             $return .= '>' . "\n";
             if ($wp_3_5) {
                 if ($images) {
                     foreach ($images as $attachment_id) {
                         $return .= '<div class="portfolio_image">';
                         $return .= '<a href="' . wp_get_attachment_url($attachment_id) . '" rel="portfolio-gallery-' . $id . '" class="openfancybox-image">';
                         $return .= wp_get_attachment_image($attachment_id, $image_size);
                         $return .= '</a>';
                         $return .= '</div>';
                     }
                 }
             } else {
                 if ($images) {
                     foreach ($images as $image) {
                         $return .= '<div class="portfolio_image">';
                         $return .= '<a href="' . wp_get_attachment_url($image->ID) . '" rel="portfolio-gallery-' . $id . '" class="openfancybox-image">';
                         $return .= wp_get_attachment_image($image->ID, $image_size);
                         $return .= '</a>';
                         $return .= '</div>';
                     }
                 }
             }
             $return .= '</div>';
         }
         return do_shortcode($return);
     }
 }
Esempio n. 3
0
 function ishyoboy_get_footer_sidebar()
 {
     global $ish_options, $ish_woo_id, $id_404;
     if (is_404()) {
         $post_id = $id_404;
     } elseif (isset($ish_woo_id)) {
         $post_id = $ish_woo_id;
     } else {
         $post_id = is_tax() || is_search() || is_archive() || is_category() || is_tag() ? null : ish_get_the_ID();
     }
     $local = '';
     if (is_home()) {
         $meta = get_post_meta(get_option('page_for_posts'));
         $local = isset($meta['ishyometa_ishyoboy_use_footer_widget_area']) ? $meta['ishyometa_ishyoboy_use_footer_widget_area'][0] : '';
     } elseif (null != $post_id) {
         $local = IshYoMetaBox::get('ishyoboy_use_footer_widget_area', true, $post_id);
     } else {
         if (is_tax() || is_search() || is_archive() || is_category() || is_tag()) {
             $local = '';
         } else {
             $local = IshYoMetaBox::get('ishyoboy_use_footer_widget_area');
         }
     }
     if ('' != $local) {
         if ('1' == $local) {
             // Use expandable
             if (is_home()) {
                 $sidebar_set = isset($meta['ishyometa_ishyoboy_footer_sidebar']) ? $meta['ishyometa_ishyoboy_footer_sidebar'][0] : '';
             } else {
                 $sidebar_set = IshYoMetaBox::get('ishyoboy_footer_sidebar', true, $post_id);
             }
             return $sidebar_set;
         } else {
             return '';
         }
     } else {
         // Default theme options
         return isset($ish_options['footer_widget_area']) && '1' == $ish_options['footer_widget_area'] && isset($ish_options['footer_sidebar']) && is_active_sidebar($ish_options['footer_sidebar']) ? $ish_options['footer_sidebar'] : '';
     }
 }