function folio_columns_content($column_name, $post_ID)
{
    if ($column_name == 'thumbnail') {
        $post_featured_image = folio_get_featured_image($post_ID);
        if ($post_featured_image) {
            echo '<img  width="48" height="48" src="' . $post_featured_image . '" />';
        }
    }
    //getting designation
    if ($column_name == 'designation') {
        $designation = get_post_meta($post_ID, 'folio_designation', true);
        if ($designation) {
            echo $designation;
        } else {
            echo "N/A";
        }
    }
    //getting skills
    if ($column_name == 'skills') {
        $skills = get_post_meta(get_the_ID(), 'folio_add_skill', true);
        $count = count($skills) - 1;
        if (count($skills) > 0) {
            foreach ($skills as $key => $skill) {
                if ($count == $key) {
                    echo $skill['folio_re_skill_name'];
                } else {
                    echo $skill['folio_re_skill_name'] . ',';
                }
            }
        } else {
            echo "N/A";
        }
    }
}
Example #2
0
function folio_get_posts_array($post_type = '', $get_by = 'image')
{
    $posts = '';
    $qry = new WP_Query(array('post_type' => $post_type, 'posts_per_page' => -1));
    if ($qry->have_posts()) {
        while ($qry->have_posts()) {
            $qry->the_post();
            if ($get_by == 'id') {
                $posts[get_the_ID()] = get_the_title();
            } elseif ($get_by == 'image') {
                $posts[' <img src="' . aq_resize(folio_get_featured_image(get_the_id()), 32, 32, true) . '" alt="" title="' . get_the_title() . '" />'] = get_the_ID();
            }
        }
    }
    return $posts;
}
Example #3
0
function folio_team_post($atts, $content = null)
{
    $output = $thumbs = $stats = $description = $social = '';
    //enqueue bx slider style and script
    extract(shortcode_atts(array('display_members' => '', 'display_selected' => '', 'show_next_prev' => '', 'el_class' => ''), $atts));
    if ($display_selected) {
        $display_selected = explode(',', $display_selected);
    }
    ob_start();
    if (isset($display_selected) && count($display_selected > 0)) {
        $args = array('post_type' => 'folio_team', 'posts_per_page' => $display_members, 'post__in' => $display_selected);
    } else {
        $args = array('post_type' => 'folio_team', 'posts_per_page' => $display_members);
    }
    $query = new WP_Query($args);
    $total_posts = $query->found_posts;
    $count = 1;
    $carouselId = folio_random_id(5);
    $sliderId = folio_random_id(6);
    $key_team = wp_generate_password(5, false, false);
    $key_stat = wp_generate_password(5, false, false);
    wp_enqueue_script('flexslider_js');
    wp_enqueue_script('custom_team_js');
    wp_localize_script('custom_team_js', 'folio_carousel_' . $key_team, array('carouselId' => $carouselId, 'sliderId' => $sliderId, 'show_next_prev' => $show_next_prev));
    if ($query->have_posts()) {
        ?>

                <!-- team_carousel starts -->
<div id="carousel_<?php 
        echo $carouselId;
        ?>
" class="team_carousel" data-key = "<?php 
        echo $key_team;
        ?>
">
    <ul class="slides">
<?php 
        while ($query->have_posts()) {
            $query->the_post();
            if (has_post_thumbnail(get_the_ID())) {
                $designation = get_post_meta(get_the_ID(), 'folio_designation', true);
                $skills = get_post_meta(get_the_ID(), 'folio_add_skill', true);
                $socials['fa-facebook'] = get_post_meta(get_the_ID(), 'folio_facebook', true);
                $socials['fa-linkedin'] = get_post_meta(get_the_ID(), 'folio_linkedin', true);
                $socials['fa-twitter'] = get_post_meta(get_the_ID(), 'folio_twitter', true);
                $socials['fa-google-plus'] = get_post_meta(get_the_ID(), 'folio_googleplus', true);
                ?>
		 <?php 
                if (count($skills) > 1) {
                    foreach ($skills as $skill) {
                        $skill_name = $skill['folio_re_skill_name'];
                        $skill_percentage = $skill['folio_re_skill_percentage'];
                        $stats .= '<span class="team_stats">
						<span class="stats_bar_holder">
							<span class="stats_bar" data-percent="' . $skill_percentage . '"></span>
						</span>
						<span class="stats_title">' . $skill_name . '</span>
					</span>';
                    }
                }
                ?>

            <li>
            <img src="<?php 
                echo aq_resize(folio_get_featured_image(get_the_id()), 291, 310, true);
                ?>
" alt="<?php 
                the_title();
                ?>
" />
                <div class="member_basic">
                    <h3 class="member_name"><?php 
                the_title();
                ?>
</h3>
                    <p class="member_designation"><?php 
                echo $designation;
                ?>
</p>
                </div>
            </li>
<?php 
                foreach ($socials as $class => $link) {
                    if (!empty($link)) {
                        $social .= '<li><a href="' . $link . '"><i class="fa ' . $class . '"></i></a></li>';
                    }
                }
                $description .= '<li>
					<div class="col-sm-3">
						' . $stats . '
						<ul class="team_social">
							' . $social . '
						</ul>
					</div>
					<div class="col-xs-offset-1 col-sm-7 team_description">
						' . get_the_content() . '
					</div>
				</li>';
                $stats = '';
                $social = '';
                ?>
    	<?php 
            }
            ?>
	<?php 
        }
        ?>
    </ul>
</div>
<!-- team_carousel ends -->
<!-- team_slider starts -->
    <div class="row">
        <div class="col-sm-12">
            <div class="row">
                <div id="slider_<?php 
        echo $sliderId;
        ?>
" class="team_slider">
                    <ul class="slides">
                        <?php 
        echo $description;
        ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
                <!-- team_slider ends -->
<?php 
    }
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}