/**
  * Get portfolio post for widget
  *
  * @since roen 1.0
  */
 function roen_get_portfolio_recent_post($type, $num, $style = 1, $ids = '', $rand = "")
 {
     global $portfolio_recent_post_content;
     if ($type == "recent") {
         if ($rand == "yes") {
             $rand = "rand";
         } else {
             $rand = "";
         }
         $portfolios = penguin_get_custom_post_posts('recent', $num, $rand);
     } else {
         if ($type == "featured") {
             $portfolios = penguin_get_custom_post_posts('featured', $num, '', '', '', $ids);
         }
     }
     $output = "";
     if ($portfolios != "" && $portfolios->have_posts()) {
         $output .= '<ul class="widget-portfolio-recent mline recent-style-' . esc_attr($style) . '">';
         while ($portfolios->have_posts()) {
             $portfolios->the_post();
             $portfolio_recent_post_content = "";
             $output .= '<li>';
             get_template_part('template/portfolio/widget/recent-style', esc_attr($style));
             $output .= $portfolio_recent_post_content;
             $output .= '</li>';
         }
         $output .= '</ul>';
     }
     wp_reset_postdata();
     return $output;
 }
Esempio n. 2
0
function roen_member_list_func($atts, $content = null)
{
    global $member_shortcode_content;
    extract(shortcode_atts(array('number' => '4', 'columns' => '4', 'type' => '', 'style' => '1', 'orderby' => '', 'cat__in' => '', 'post__in' => '', 'post__not_in' => '', 'effect' => ''), $atts));
    $output = "";
    $members = penguin_get_custom_post_posts($type, $number, $orderby, $cat__in, '', $post__in, $post__not_in, 'member');
    if ($members != "" && $members->have_posts()) {
        $columns = intval($columns) - 2;
        $member_shortcode_columns = roen_get_element_columns(intval($columns));
        if ($effect != "" && $effect != "none") {
            $output .= '<div class="row"><div class="roen-shortcode-member-post animate-list">';
        } else {
            $output .= '<div class="row"><div class="roen-shortcode-member-post">';
        }
        while ($members->have_posts()) {
            $members->the_post();
            $member_shortcode_content = "";
            if ($effect != "" && $effect != "none") {
                $output .= '<article id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class('shortcode-member-entry member-element member-style-' . esc_attr($style) . ' ' . esc_attr($member_shortcode_columns))) . ' animate-item" data-effect="' . esc_attr($effect) . '" itemscope itemtype="http://schema.org/CreativeWork">';
            } else {
                $output .= '<article id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class('shortcode-member-entry member-element member-style-' . esc_attr($style) . ' ' . esc_attr($member_shortcode_columns))) . '" itemscope itemtype="http://schema.org/CreativeWork">';
            }
            get_template_part('template/member/shortcode/content-style', esc_attr($style));
            $output .= $member_shortcode_content;
            $output .= '</article>';
        }
        $output .= '</div></div>';
    }
    wp_reset_postdata();
    return $output;
}