Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Register shortcode Teacher ********************************************/
- function section_feed_shortcode( $atts ) {
- extract( shortcode_atts( array( 'limit' => 12, 'type' => 'our-teacher', 'category' => '', 'title' => ''), $atts ) );
- $paged = get_query_var('paged') ? get_query_var('paged') : 1;
- query_posts( array (
- 'posts_per_page' => $limit,
- 'post_type' => $type,
- 'order' => 'DESC',
- 'teacher_cat' => $category,
- 'paged' => $paged ) );
- $list = '<div class="member"><h2>'.$title.'</h2></div>';
- while ( have_posts() ) { the_post();
- $list .='<div class="single_team col-md-3">'
- .''.get_the_post_thumbnail( $post->ID, 'teacher-thumbnail' ).''
- .'<h2>'.get_the_title().'</h2>'
- .'<p>'.get_the_content().'</p>'
- .'<div class="social_bookmark">'
- .'<a href="#">'.get_post_meta( get_the_ID(), 'mobile', true ).'</i></a>'
- .'<a href="'.get_post_meta( get_the_ID(), 'facebook_link', true ).'"><i class="fa fa-facebook"></i></a>'
- .'<a href="mailto:'.get_post_meta( get_the_ID(), 'email', true ).'"><i class="fa fa-envelope"></i></a>'
- .'</div>'
- .'</div>';
- }
- return
- '<div class="listings clearfix">'
- . $list
- . '<div class="nav-previous">' . get_next_posts_link( __( '<span class="meta-nav">←</span> Older posts' ) ) . '</div>'
- . '<div class="nav-next">' . get_previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>' ) ) . '</div>'
- . '</div>' .
- wp_reset_query();
- }
- add_shortcode( 'our_teacher', 'section_feed_shortcode' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement