Beispiel #1
0
 /**
  *
  */
 function miss_page_navi()
 {
     echo '<div class="miss_pagenavi">';
     echo miss_pagenavi();
     echo '</div><!-- .miss_pagenavi -->';
 }
Beispiel #2
0
 function _staff_shortcode($args = array())
 {
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     extract($args['atts']);
     $out = '';
     $showposts = trim($showposts);
     $column = !empty($column) ? trim($column) : '3';
     $thumb = !empty($thumb) ? trim($thumb) : 'medium';
     $offset = isset($offset) ? trim($offset) : '';
     $post_in = !empty($post_in) ? explode(",", trim($post_in)) : '';
     $category_in = !empty($category_in) ? explode(",", trim($category_in)) : '';
     $tag_in = !empty($tag_in) ? explode(",", trim($tag_in)) : '';
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout');
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' || $template == 'templates/template-wiki.php' ? 'small_sidebar_images' : 'big_sidebar_images');
     }
     $post_img = '';
     $staff_query = new WP_Query();
     if (trim($pagination) == 'true') {
         $paged = miss_get_page_query();
         $staff_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'staff', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     } else {
         $staff_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'staff', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     }
     if ($staff_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         if ($args['type'] == 'staff_grid') {
             $column = $column > 0 || $column < 4 ? $column : 4;
             switch ($column) {
                 case 1:
                     $main_class = 'grid one_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $excerpt_lenth = 400;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 2:
                     $main_class = 'grid two_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span6';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 3:
                     $main_class = 'grid three_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span4';
                     $excerpt_lenth = 75;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 4:
                     $main_class = 'grid four_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span3';
                     $excerpt_lenth = 10;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 default:
                     $main_class = 'grid four_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span3';
                     $excerpt_lenth = 10;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
             }
         }
         if ($caption != '') {
             $out .= '					<div class="blog_header">';
             $out .= '						<h4 class="pull-left caption">';
             $out .= '							' . $caption;
             $out .= '						</h4>';
             $out .= '						<h6 class="pull-left tagline">';
             $out .= '							' . $tagline;
             $out .= '						</h6>';
             $out .= '						<div class="clearboth">';
             $out .= '						</div>';
             $out .= '					</div><!-- /.blog_header-->';
         }
         $filter_args = array('width' => $width, 'height' => $height, 'img_class' => $img_class, 'link_class' => 'staff_sc_image_load', 'preload' => true, 'no_link' => true, 'post_content' => $post_content, 'disable' => $disable, 'column' => $column, 'thumb' => $thumb, 'type' => $args['type'], 'shortcode' => true, 'echo' => false);
         $out .= $args['type'] == 'staff_grid' ? '<div class="sc_layout ' . $main_class . '"><div class="row-fluid">' : '<ul class="' . $main_class . '">';
         $spans_in_row = $column;
         $span_walk = 0;
         $row_walk = 1;
         while ($staff_query->have_posts()) {
             $staff_query->the_post();
             if ($spans_in_row * $row_walk == $span_walk) {
                 $out .= '</div><!-- /.row-fluid --> <div class="row-fluid">';
             } else {
                 $out .= '';
             }
             if ($spans_in_row * $row_walk == $span_walk) {
                 $row_walk++;
             }
             $span_walk++;
             if (!empty($animation)) {
                 $animation = ' im-transform im-animate-element ' . $animation;
             }
             $out .= $args['type'] == 'staff_list' ? '' : ($column != 1 ? '<div class="' . $column_class . $animation . '">' : '');
             $out .= $args['type'] == 'staff_grid' ? '<div class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">' : '<li class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">';
             if (in_array('post_list_image', $filter_args)) {
                 $filter_args = array_merge($filter_args, array('inline_width' => true));
             }
             if (strpos($filter_args['disable'], 'image') === false) {
                 //				$image = miss_get_post_image( $filter_args );
                 //				$out .= str_replace( array( '<a', '</a' ), array( '<span', '</span' ), $image) ;
                 $out .= miss_get_post_image($filter_args);
             }
             if (strpos($filter_args['disable'], 'title') === false) {
                 $out .= $title = the_title('<h2 class="post_title">', '</h2>', false);
             }
             if (strpos($filter_args['disable'], 'meta') === false) {
                 $out .= miss_post_meta_diferent($filter_args);
             }
             $out .= '<div class="employee_position">' . get_post_meta(get_the_id(), 'position', true) . '</div>';
             $out .= '<div class="' . $content_class . '">';
             $out .= '<div class="post_excerpt">';
             if (strpos($disable, 'content') === false) {
                 $out .= miss_excerpt(get_the_excerpt(), 115, THEME_ELLIPSIS);
                 if (!empty($disable) && strpos($disable, 'more') === false || empty($disable)) {
                     $out .= miss_full_read_more();
                 }
             }
             $out .= '</div>';
             //		$out .= miss_after_entry_sc( $filter_args );
             $sociable_pages = get_post_meta(get_the_id(), 'sociable');
             foreach ($sociable_pages[0] as $key => $value) {
                 //$out .= $key ;
                 if ($key != '#' and $key != 'keys') {
                     $out .= '<a class="sociable_icon" href="' . $value['link'] . '"><i class="fs-icon-' . $value['icon'] . '"></i></a>';
                 }
             }
             $out .= '<div class="clearboth"></div>';
             $out .= '</div><!-- .post_class -->';
             $out .= $args['type'] == 'staff_grid' ? '</div>' : '</li>';
             $out .= $args['type'] == 'staff_list' ? '' : ($column != 1 ? '</div>' : '');
         }
         $out .= $args['type'] == 'staff_grid' ? '</div></div>' : '</ul>';
         if ($pagination == 'true') {
             $out .= miss_pagenavi('', '', $staff_query);
         }
     }
     wp_reset_query();
     return $out;
 }
Beispiel #3
0
		</div>
		<div class="pagination no-ajax">

			<h4 id="post-count" class="pag-count">
			<span>
				<?php 
    bp_the_topic_pagination_count();
    ?>
			</span></h4>

			<div class="pagination-links" id="topic-pag">
				<?php 
    bp_the_topic_pagination();
    ?>
				<?php 
    echo miss_pagenavi();
    ?>
			</div>

		</div>

		<?php 
    if (is_user_logged_in() && 'public' == bp_get_group_status() || bp_group_is_member()) {
        ?>

			<?php 
        if (bp_get_the_topic_is_last_page()) {
            ?>

				<?php 
            if (bp_get_the_topic_is_topic_open()) {
Beispiel #4
0
 /**
  *
  */
 public static function portfolio_grid($atts)
 {
     if ($atts == 'generator') {
         $option = array('name' => __('Portfolio Grid', MISS_ADMIN_TEXTDOMAIN), 'value' => 'portfolio_grid', 'options' => array(array('name' => __('Number of Columns', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of columns you would like your posts to display in.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'column', 'default' => '', 'options' => array('1' => __('One Column', MISS_ADMIN_TEXTDOMAIN), '2' => __('Two Column', MISS_ADMIN_TEXTDOMAIN), '3' => __('Three Column', MISS_ADMIN_TEXTDOMAIN), '4' => __('Four Column', MISS_ADMIN_TEXTDOMAIN)), 'type' => 'select'), array('name' => __('Number of Portfolio Posts', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of posts you would like to display on each page.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'showposts', 'default' => '', 'options' => array_combine(range(1, 40), array_values(range(1, 40))), 'type' => 'select'), array('name' => __('Portfolio Categories <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select which portfolio categories you would like to display.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'cat', 'default' => array(), 'target' => 'portfolio_category', 'type' => 'select'), array('name' => __('Offset Portfolio Posts <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('This will skip a number of posts at the beginning.<br /><br />Useful if you are using multiple portfolio shortcodes on the same page.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'offset', 'default' => '', 'options' => array_combine(range(1, 10), array_values(range(1, 10))), 'type' => 'select'), array('name' => __('Disable Portfolio Elements <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('You can hide certain elements from displaying here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'disable', 'options' => array('image' => __('Disable Post Image', MISS_ADMIN_TEXTDOMAIN), 'title' => __('Disable Post Title', MISS_ADMIN_TEXTDOMAIN), 'excerpt' => __('Disable Post Excerpt', MISS_ADMIN_TEXTDOMAIN), 'date' => __('Disable Date', MISS_ADMIN_TEXTDOMAIN), 'more' => __('Disable Read More', MISS_ADMIN_TEXTDOMAIN), 'visit' => __('Disable Visit Site', MISS_ADMIN_TEXTDOMAIN), 'pagination' => __('Disable Pagination', MISS_ADMIN_TEXTDOMAIN)), 'default' => '', 'type' => 'checkbox'), 'shortcode_has_atts' => true));
         return $option;
     }
     extract(shortcode_atts(array('column' => '4', 'showposts' => '8', 'cat' => array(), 'offset' => '', 'disable' => ''), $atts));
     $out = '';
     $portfolio_query = new WP_Query();
     if (isset($cat)) {
         global $post, $wp_rewrite, $wp_query, $irish_framework_params;
         $column = trim($column);
         $showposts = trim($showposts);
         //			$cat = trim( $cat );
         $offset = trim($offset);
         if (is_front_page()) {
             $_layout = miss_get_setting('homepage_layout');
             //				$images = ( $_layout == 'full_width' ? 'images' : ( $_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images' ) );
         } else {
             $post_obj = $wp_query->get_queried_object();
             $_layout = get_post_meta($post_obj->ID, '_layout', true);
             //				$images = ( $_layout == 'full_width' ? 'images' : ( $_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images' ) );
         }
         $paged = miss_get_page_query();
         $gallery_post = $post->post_name;
         if ($post->post_parent) {
             $parent_query = get_post($post->post_parent);
             $gallery_parent = $parent_query->ID;
         }
         if (is_numeric($offset) && strpos($disable, 'pagination') === false) {
             $irish_framework_params->offset = $offset;
             $irish_framework_params->posts_per_page = $showposts;
             add_filter('post_limits', 'my_post_limit');
         }
         if (strpos($disable, 'pagination') === false) {
             $args = array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'taxonomy' => 'portfolio_category', 'term' => $cat, 'offset' => $offset, 'paged' => $paged);
         } else {
             $args = array('post_type' => 'portfolio', 'showposts' => $showposts, 'taxonomy' => 'portfolio_category', 'term' => $cat, 'offset' => $offset, 'nopaging' => 0);
         }
         if (isset($cat) && !empty($cat)) {
             $args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat));
         }
         $portfolio_query = new WP_Query();
         $portfolio_query->query($args);
     }
     if ($portfolio_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout['big_sidebar_images'];
         $img_group = 'portfolio_img_group_' . rand(1, 1000);
         $width = '';
         $height = '';
         switch ($column) {
             case 1:
                 $column_class = 'span12 has_preview';
                 $width = $img_sizes['span12'][0];
                 $height = $img_sizes['span12'][1];
                 break;
             case 2:
                 $column_class = 'span6 has_preview';
                 $width = $img_sizes['span6'][0];
                 $height = $img_sizes['span6'][1];
                 break;
             case 3:
                 $column_class = 'span4 has_preview';
                 $width = $img_sizes['span4'][0];
                 $height = $img_sizes['span4'][1];
                 break;
             case 4:
                 $column_class = 'span3 has_preview';
                 $width = $img_sizes['span3'][0];
                 $height = $img_sizes['span3'][1];
                 break;
         }
         $main_class = 'loop_module works portfolio row-fluid';
         $out .= '<div class="' . $main_class . '">';
         $i = 1;
         while ($portfolio_query->have_posts()) {
             $portfolio_query->the_post();
             $id = get_the_ID();
             $custom_fields = get_post_custom($id);
             foreach ($custom_fields as $key => $value) {
                 ${$key}[$id] = $value[0];
                 if (is_serialized(${$key}[$id])) {
                     ${$key}[$id] = unserialize(${$key}[$id]);
                 }
             }
             if (has_post_thumbnail() || !empty($_image[$id]) || !empty($_featured_video[$id])) {
                 if (has_post_thumbnail()) {
                     $img = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full', true);
                 } else {
                     $img[0] = !empty($_image[$id]) ? $_image[$id] : '';
                 }
                 if ($wp_rewrite->using_permalinks()) {
                     $url = home_url('/') . 'portfolio/' . $post->post_name . '/gallery/' . $gallery_post . '/';
                 } else {
                     $url = htmlspecialchars(add_query_arg(array('gallery' => $gallery_post), get_permalink($id)));
                 }
                 $link_to = empty($_post[$id][0]) ? empty($_featured_video[$id]) ? empty($_image[$id]) ? $img[0] : $_image[$id] : $_featured_video[$id] : $url;
                 $out .= '<div class="portfolio_item ' . ($i % $column == 0 ? $column_class . ' last' : $column_class) . ' im-transform im-animate-element scale-up">';
                 $out .= '<div class="' . join(' ', get_post_class('post_grid_module', get_the_ID())) . '">';
                 if (strpos($disable, 'image') === false) {
                     $offset = $irish_framework_params->layout['images']['image_padding'];
                     $load_width = $width + $offset;
                     $load_height = $height + $offset;
                     $out .= '<div class="post_grid_image" data-style="width:' . $load_width . 'px;">';
                     ob_start();
                     miss_portfolio_image_begin();
                     $out .= ob_get_clean();
                     if (empty($img[0]) && !empty($_featured_video[$id])) {
                         $video_check = miss_video($args = array('url' => $_featured_video[$id], 'parse' => true, 'width' => $width, 'height' => $height));
                     } else {
                         $video_check = false;
                     }
                     if (!empty($video_check)) {
                         $out .= $video_check;
                     } else {
                         $out .= miss_display_image(array('src' => $img[0], 'alt' => '', 'title' => '', 'height' => $height, 'width' => $width, 'class' => 'hover_fade_js', 'link_to' => $link_to, 'img_class' => 'post_grid_image has_preview', 'link_class' => 'portfolio_img_load', 'prettyphoto' => empty($_post[$id][0]) ? true : false, 'group' => $img_group, 'preload' => false));
                     }
                     ob_start();
                     miss_portfolio_image_end(array('column' => $column, 'disable' => $disable, 'date' => !empty($_date[$id]) ? $_date[$id] : ''));
                     $out .= ob_get_clean();
                     $out .= '</div>';
                 }
                 $out .= '<div class="first_layer color_frame">';
                 $out .= '<div class="second_layer sidebar_framed_caption">';
                 if (strpos($disable, 'title') === false) {
                     $out .= '<div class="portfolio_item_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></div>';
                     //				$title = ( empty( $_more[$id][0] ) ) ? '<a href="' . esc_url( $url ) . '">' . get_the_title( $id ) . '</a>' : get_the_title( $id );
                     /*
                     if( $column == 1 || $column == 2 )
                     	$out .= '<h2 class="post_title">' . $title . '</h2>';
                     else
                     	$out .= '<h3 class="post_title">' . $title . '</h3>';
                     */
                 }
                 if (strpos($disable, 'meta') === false) {
                     $out .= '<div class="portfolio_item_meta">' . miss_post_meta_diferent(array('echo' => false)) . '</div>';
                 }
                 /*			
                 			if( ( !empty( $_date[$id] ) ) && ( strpos( $disable, 'date' ) === false ) )
                 				$out .= apply_filters( 'miss_portfolio_date', '<p class="date">' . $_date[$id] . '</p>', array( 'column' => $column ) );
                 			
                 			
                 			if( empty( $_more[$id][0] ) || !empty( $_link[$id] ) || !empty( $_teaser[$id] ) ) {
                 				$out .= '<div class="post_excerpt">';
                 				
                 				$out .= ( ( !empty( $_teaser[$id] ) ) && ( strpos( $disable, 'excerpt' ) === false ) ) ? '<p>' . do_shortcode( $_teaser[$id] ) . '</p>' : '';
                 				
                 				if( empty( $_more[$id][0] ) || !empty( $_link[$id] ) ) {
                 					$out .= '<p>';
                 */
                 /*
                 if( ( empty( $_more[$id][0] ) ) && ( strpos( $disable, 'more' ) === false ) ) {
                 	$read_more = '<a href="' . esc_url( $url )  . '" class="post_more_link">' . __( 'Read More', MISS_TEXTDOMAIN ) . '</a>&nbsp;&nbsp;';
                 	$out .= apply_filters( 'miss_portfolio_read_more', $read_more, esc_url( $url ) );
                 }
                 
                 if( ( !empty( $_link[$id] ) ) && ( strpos( $disable, 'visit' ) === false ) ) {
                 	$visit_site = '<a href="' . esc_url( $_link[$id] )  . '" class="post_more_link">' . __( 'Visit Site', MISS_TEXTDOMAIN ) . '</a>';
                 	$out .= apply_filters( 'miss_portfolio_visit_site', $visit_site, esc_url( $_link[$id] ) );
                 }
                 */
                 /*
                 					$out .= '</p>';
                 				}
                 				
                 				$out .= '</div>';
                 			}
                 */
                 $out .= '</div><!-- /.second_layer-->';
                 $out .= '</div><!-- /.first_layer-->';
                 $out .= '</div>';
                 $out .= '</div><!-- /.portfolio_item -->';
                 if ($i % $column == 0) {
                     $out .= '<div class="clearboth"></div>';
                 }
                 $i++;
             }
         }
         $out .= '</div>';
         $out .= strpos($disable, 'pagination') === false ? miss_pagenavi('', '', $portfolio_query) : '';
     } else {
         $out .= __('No portfolio posts were found for the category selected.', MISS_TEXTDOMAIN);
     }
     if (is_numeric($offset) && strpos($disable, 'pagination') === false) {
         remove_filter('post_limits', 'my_post_limit');
     }
     wp_reset_query();
     //return '[raw]' . $out . '[/raw]';
     return $out;
 }