Пример #1
0
 function posttype_custom_columns($column)
 {
     global $post;
     switch ($column) {
         case "thumbnail":
             echo post_image_show() ? post_image_show(45, 45) : "<img src='" . THEME_DIR . "/resources/images/no-thumb.png'>";
             break;
         case "cause":
             echo get_the_term_list($post->ID, 'cat_cause', '', ', ', '');
             break;
         case "portfolio":
             echo get_the_term_list($post->ID, 'cat_portfolio', '', ', ', '');
             break;
         case "event":
             echo get_the_term_list($post->ID, 'cat_event', '', ', ', '');
             break;
         case "price":
             echo get_the_term_list($post->ID, 'cat_price', '', ', ', '');
             break;
         case "team":
             echo get_the_term_list($post->ID, 'cat_team', '', ', ', '');
             break;
         case "testimonial":
             echo get_the_term_list($post->ID, 'cat_testimonial', '', ', ', '');
             break;
     }
 }
Пример #2
0
function jw_social_share()
{
    $post_link = get_permalink();
    $output = '<div class="jw_post_sharebox clearfix">';
    $output .= '<span>Share this story:</span>';
    if (jw_option('facebook_share')) {
        $output .= '<div class="facebook_share"><iframe src="http' . (is_ssl() ? 's' : '') . '://www.facebook.com/plugins/like.php?href=' . urlencode($post_link) . '&amp;layout=button_count&amp;show_faces=false&amp;width=70&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"></iframe></div>';
    }
    if (jw_option('googleplus_share')) {
        $output .= '<div class="googleplus_share"><g:plusone size="medium" href="' . $post_link . '"></g:plusone></div>';
    }
    if (jw_option('twitter_share')) {
        $post_title = get_the_title();
        $output .= '<div class="twitter_share"><a href="http' . (is_ssl() ? 's' : '') . '://twitter.com/share" class="twitter-share-button" data-url="' . $post_link . '" data-width="100"  data-text="' . $post_title . '" data-count="horizontal"></a></div>';
    }
    if (jw_option('pinterest_share')) {
        $post_image = post_image_show(0, 0, true);
        $output .= '<div class="pinterest_share"><a href="http' . (is_ssl() ? 's' : '') . '://pinterest.com/pin/create/button/?url=' . $post_link . '&media=' . $post_image . '" class="pin-it-button" count-layout="horizontal"></a></div>';
    }
    if (jw_option('linkedin_share')) {
        $output .= '<div class="linkedin_share"><script type="in/share" data-url="' . $post_link . '" data-counter="right"></script></div>';
    }
    $output .= '</div>';
    return $output;
}
Пример #3
0
 function shortcode_jw_partner($atts, $content)
 {
     $category_list = isset($atts['partner_category_list']) ? $atts['partner_category_list'] : '';
     //$arrow = '<div class="carousel-arrow jw-carrow">';
     //$arrow .= '<a class="carousel-prev" href="#"><i class="icon-angle-left"></i></a>';
     //$arrow .= '<a class="carousel-next" href="#"><i class="icon-angle-right"></i></a>';
     //$arrow .= '</div>';
     $output = '<div class="carousel-container">';
     $output .= '<div class="jw-carousel-partner list_carousel">';
     $output .= '<ul class="jw-carousel">';
     $query = array('post_type' => 'jw_partner', 'posts_per_page' => -1);
     $cats = explode(",", $category_list);
     $imgwidth = 270;
     if (!empty($cats[0])) {
         $query['tax_query'] = array(array('taxonomy' => 'cat_partner', 'terms' => $cats, 'field' => 'id'));
     }
     if (!empty($atts['order'])) {
         switch ($atts['order']) {
             case "date_asc":
                 $query['orderby'] = 'date';
                 $query['order'] = 'ASC';
                 break;
             case "title_asc":
                 $query['orderby'] = 'title';
                 $query['order'] = 'ASC';
                 break;
             case "title_desc":
                 $query['orderby'] = 'title';
                 $query['order'] = 'DESC';
                 break;
             case "random":
                 $query['orderby'] = 'rand';
                 break;
         }
     }
     // START - LOOP
     query_posts($query);
     while (have_posts()) {
         the_post();
         $imgheight = $atts['image_height'];
         $output .= '<li>';
         if (get_metabox('link') != '') {
             $output .= '<a href="' . to_url(get_metabox('link')) . '" target="_blank">';
             $output .= post_image_show($imgwidth, $imgheight);
             $output .= '</a>';
         } else {
             $output .= post_image_show($imgwidth, $imgheight);
         }
         $output .= '</li>';
     }
     wp_reset_query();
     // END   - LOOP
     $output .= '</ul>';
     $output .= '<div class="clearfix"></div>';
     //$output .= $arrow;
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }