isMobile())?'true':'false'; $pluginOpts = new AxPluginOptions(); $labels = $pluginOpts->getLabels(); $colors = $pluginOpts->getColors(); $opts = $pluginOpts->getOptions(); $rx_query = array('post_type' => AX_PORTFOLIO_SLUG, 'paged'=>$paged, 'posts_per_page' =>$opts['max_portfolio_posts']); $out = '
'; $query = new WP_Query($rx_query); if($query->have_posts()) { while($query->have_posts()){ $count_posts++; $query->the_post(); $id = get_the_ID(); $title = get_the_title($id); $post_options = new AxPostOptions(get_the_ID()); $subtitle = $post_options->getSubtitle(); $featuredImageURL = $post_options->getFeaturedImageURL(get_the_ID()); $out .= '

'.$title.'

'.$subtitle.'

'.$labels['readMoreLB'].'
'; } } else { // no posts found //echo "no posts found"; } $pagination = new RxBlogPagination(); $pagination_html = $pagination->kriesi_pagination($query->max_num_pages, 2); $out .= '
'; $out .= $pagination_html; $out .= '
'; $out .= '
'; wp_reset_query(); if($count_posts!=1 && $count_posts!=0){ $out .= '
'; for ($i=0; $i < $count_posts; $i++){ $out .= '
'; } $out .= '
'; } $out .= '
'; return $out; } /* three cols shortcode ================================================== */ public function rx_aeolus_three_cols($atts, $content = null){ extract(shortcode_atts(array('category_slug' => ''), $atts)); $rx_query = array('post_type' => AX_PORTFOLIO_SLUG, 'posts_per_page' =>'-1'); if($category_slug!=''){ $term = term_exists($category_slug); if ($term == 0 || $term == null) { echo "The ".$category_slug." does not exist!"; return; } $term_id = $term; if(is_array($term)){ $term_id = $term['term_id']; } $args = array( 'tax_query' => array( array( 'taxonomy' => 'ae_portfolio_categories', 'field' => 'id', 'terms' => $term_id ) ) ); $rx_query = array_merge($rx_query, $args); } $out = '
'; $query = new WP_Query($rx_query); if($query->have_posts()) { $groupCount = -1; while($query->have_posts()){ $groupCount++; if($groupCount==0){ $out .= '
'; //echo $groupCount." -open row
"; } $query->the_post(); $id = get_the_ID(); $post_options = new AxPostOptions($id); $thumbnail_url = $post_options->getFeaturedImage($id, 800, 650); $title = get_the_title($id); $out .= '

'.$title.'

'; if($groupCount==2){ //echo $groupCount." -close row
"; $out .= '
'; $groupCount = -1; } } if($groupCount==0 || $groupCount==1){ //echo $groupCount." -close row final
"; $out .= '
'; } } else { // no posts found //echo "no posts found"; } /* Restore original Post Data */ wp_reset_query(); $out .= ''; return $out; } /* two cols shortcode ================================================== */ public function rx_aeolus_two_cols($atts, $content = null){ extract(shortcode_atts(array('category_slug' => ''), $atts)); $rx_query = array('post_type' => AX_PORTFOLIO_SLUG, 'posts_per_page' =>'-1'); if($category_slug!=''){ $term = term_exists($category_slug); if ($term == 0 || $term == null) { echo "The ".$category_slug." does not exist!"; return; } $term_id = $term; if(is_array($term)){ $term_id = $term['term_id']; } $args = array( 'tax_query' => array( array( 'taxonomy' => 'ae_portfolio_categories', 'field' => 'id', 'terms' => $term_id ) ) ); $rx_query = array_merge($rx_query, $args); } $out = '
'; $query = new WP_Query($rx_query); if($query->have_posts()) { $groupCount = -1; while($query->have_posts()){ $groupCount++; if($groupCount==0){ $out .= '
'; //echo $groupCount." -open row
"; } $query->the_post(); $id = get_the_ID(); $post_options = new AxPostOptions($id); $thumbnail_url = $post_options->getFeaturedImage($id, 800, 650); $title = get_the_title($id); $out .= '

'.$title.'

'; if($groupCount==1){ //echo $groupCount." -close row
"; $out .= '
'; $groupCount = -1; } } if($groupCount==0){ //echo $groupCount." -close row final
"; $out .= '
'; } } else { // no posts found } /* Restore original Post Data */ wp_reset_query(); $out .= ''; return $out; } /* one col shortcode ================================================== */ public function rx_aeolus_one_col($atts, $content = null){ extract(shortcode_atts(array('category_slug' => ''), $atts)); $rx_query = array('post_type' => AX_PORTFOLIO_SLUG, 'posts_per_page' =>'-1'); if($category_slug!=''){ $term = term_exists($category_slug); if ($term == 0 || $term == null) { echo "The ".$category_slug." does not exist!"; return; } $term_id = $term; if(is_array($term)){ $term_id = $term['term_id']; } $args = array( 'tax_query' => array( array( 'taxonomy' => 'ae_portfolio_categories', 'field' => 'id', 'terms' => $term_id ) ) ); $rx_query = array_merge($rx_query, $args); } $out = '
'; $query = new WP_Query($rx_query); if($query->have_posts()) { while($query->have_posts()){ $out .= '
'; $query->the_post(); $id = get_the_ID(); $post_options = new AxPostOptions($id); $thumbnail_url = $post_options->getFeaturedImage($id, 1200, 500, true); $title = get_the_title($id); $out .= '

'.$title.'

'; $out .= '
'; } } else { // no posts found } /* Restore original Post Data */ wp_reset_query(); $out .= '
'; return $out; } } ?>