name || 'admire' == $theme->template ) { // Add second featured image add_action( 'add_meta_boxes', 'listing_image_add_metabox' ); function listing_image_add_metabox () { add_meta_box( 'listingimagediv', __( 'Banner image', 'admire-extra' ), 'listing_image_metabox', 'post', 'side', 'low'); add_meta_box( 'listingimagediv', __( 'Banner image', 'admire-extra' ), 'listing_image_metabox', 'product', 'side', 'low'); add_meta_box( 'listingimagediv', __( 'Banner image', 'admire-extra' ), 'listing_image_metabox', 'ourservices', 'side', 'low'); add_meta_box( 'listingimagediv', __( 'Banner image', 'admire-extra' ), 'listing_image_metabox', 'team', 'side', 'low'); } function listing_image_metabox ( $post ) { global $content_width, $_wp_additional_image_sizes; $image_id = get_post_meta( $post->ID, '_listing_image_id', true ); $old_content_width = $content_width; $content_width = 254; if ( $image_id && get_post( $image_id ) ) { if ( ! isset( $_wp_additional_image_sizes['post-thumbnail'] ) ) { $thumbnail_html = wp_get_attachment_image( $image_id, array( $content_width, $content_width ) ); } else { $thumbnail_html = wp_get_attachment_image( $image_id, 'post-thumbnail' ); } if ( ! empty( $thumbnail_html ) ) { $content = $thumbnail_html; $content .= '

' . esc_html__( 'Remove banner image', 'admire-extra' ) . '

'; $content .= ''; } $content_width = $old_content_width; } else { $content = ''; $content .= '

' . esc_html__( 'Set banner image', 'admire-extra' ) . '

'; $content .= ''; } echo wp_kses_post( $content ); } add_action( 'save_post', 'listing_image_save', 10, 1 ); function listing_image_save ( $post_id ) { if ( sanitize_text_field( wp_unslash( isset( $_POST['REQUEST_URI_nonce'] ) ) ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['REQUEST_URI_nonce'], 'REQUEST_URI_nonce_action' ) ) ) ) { echo esc_html( '' ); } if( isset( $_POST['_listing_cover_image'] ) ) { $image_id = (int) $_POST['_listing_cover_image']; update_post_meta( $post_id, '_listing_image_id', $image_id ); } } // custom post type for Testimonials function admire_custom_post_testimonials() { $labels = array( 'name' => __( 'Testimonials','admire-extra'), 'singular_name' => __( 'Testimonials','admire-extra'), 'add_new' => __( 'Add Testimonials','admire-extra'), 'add_new_item' => __( 'Add New Testimonial','admire-extra'), 'edit_item' => __( 'Edit Testimonial','admire-extra'), 'new_item' => __( 'New Testimonial','admire-extra'), 'all_items' => __( 'All Testimonials','admire-extra'), 'view_item' => __( 'View Testimonial','admire-extra'), 'search_items' => __( 'Search Testimonial','admire-extra'), 'not_found' => __( 'No Testimonial found','admire-extra'), 'not_found_in_trash' => __( 'No Testimonial found in the Trash','admire-extra'), 'parent_item_colon' => '', 'menu_name' => 'Testimonials' ); $args = array( 'labels' => $labels, 'description' => 'Manage Testimonials', 'public' => true, 'menu_icon' => 'dashicons-format-quote', 'menu_position' => null, 'supports' => array( 'title', 'editor', 'thumbnail'), 'has_archive' => true, 'exclude_from_search' => true, ); register_post_type( 'testimonials', $args ); } add_action( 'init', 'admire_custom_post_testimonials' ); // add meta box to testimonials add_action( 'admin_init', 'admire_testimonial_admin_function' ); function admire_testimonial_admin_function() { add_meta_box( 'testimonial_meta_box', 'Testimonial Info', 'admire_display_testimonial_meta_box', 'testimonials', 'normal', 'high' ); } // add meta box form to doctor function admire_display_testimonial_meta_box( $testimonial ) { $companyname = esc_html( get_post_meta( $testimonial->ID, 'companyname', true ) ); $possition = esc_html( get_post_meta( $testimonial->ID, 'possition', true ) ); ?>
post_type == 'testimonials' ) { // Store data in post meta table if present in post data if ( sanitize_text_field( wp_unslash( isset( $_POST['REQUEST_URI_nonce'] ) ) ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['REQUEST_URI_nonce'], 'REQUEST_URI_nonce_action' ) ) ) ) { echo esc_html( '' ); } if ( isset($_POST['companyname']) ) { update_post_meta( $testimonial_id, 'companyname', wp_filter_kses( sanitize_text_field( wp_unslash($_POST['companyname']) ) ) ); } if ( isset($_POST['possition']) ) { update_post_meta( $testimonial_id, 'possition', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['possition']) ) ) ); } } } //custom post type for Our Team function admire_custom_post_team() { $labels = array( 'name' => __( 'Our Team', 'admire-extra' ), 'singular_name' => __( 'Our Team', 'admire-extra' ), 'add_new' => __( 'Add New', 'admire-extra' ), 'add_new_item' => __( 'Add New Team Member', 'admire-extra' ), 'edit_item' => __( 'Edit Team Member', 'admire-extra' ), 'new_item' => __( 'New Member', 'admire-extra' ), 'all_items' => __( 'All Members', 'admire-extra' ), 'view_item' => __( 'View Members', 'admire-extra' ), 'search_items' => __( 'Search Team Members', 'admire-extra' ), 'not_found' => __( 'No Team members found', 'admire-extra' ), 'not_found_in_trash' => __( 'No Team members found in the Trash', 'admire-extra' ), 'parent_item_colon' => '', 'menu_name' => 'Our Team' ); $args = array( 'labels' => $labels, 'description' => 'Manage Team', 'public' => true, 'menu_position' => null, 'show_in_rest' => true, 'menu_icon' => 'dashicons-groups', 'supports' => array( 'title', 'editor', 'thumbnail'), 'rewrite' => array('slug' => 'our-team'), 'has_archive' => true, 'exclude_from_search' => true, ); register_post_type( 'team', $args ); } add_action( 'init', 'admire_custom_post_team' ); // add meta box to team add_action( 'admin_init', 'admire_team_admin_function' ); function admire_team_admin_function() { add_meta_box( 'team_meta_box', 'Member Info', 'admire_display_team_meta_box', 'team', 'normal', 'high' ); } // add meta box form to team function admire_display_team_meta_box( $team ) { $designation = esc_html( get_post_meta( $team->ID, 'designation', true ) ); $facebook = get_post_meta( $team->ID, 'facebook', true ); $facebooklink = esc_url( get_post_meta( $team->ID, 'facebooklink', true ) ); $twitter = get_post_meta( $team->ID, 'twitter', true ); $twitterlink = esc_url( get_post_meta( $team->ID, 'twitterlink', true ) ); $instagram = get_post_meta( $team->ID, 'instagram', true ); $instagramlink = esc_url( get_post_meta( $team->ID, 'instagramlink', true ) ); $linkedin = get_post_meta( $team->ID, 'linkedin', true ); $linkedinlink = esc_url( get_post_meta( $team->ID, 'linkedinlink', true ) ); $pinterest = get_post_meta( $team->ID, 'pinterest', true ); $pinterestlink = get_post_meta( $team->ID, 'pinterestlink', true ); ?>
 
post_type == 'team' ) { // Store data in post meta table if present in post data if ( isset($_POST['designation']) ) { update_post_meta( $team_id, 'designation', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['designation']) )) ); } if ( isset($_POST['facebook']) ) { update_post_meta( $team_id, 'facebook', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['facebook']) )) ); } if ( isset($_POST['facebooklink']) ) { update_post_meta( $team_id, 'facebooklink', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['facebooklink']) )) ); } if ( isset($_POST['twitter']) ) { update_post_meta( $team_id, 'twitter', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['twitter']) )) ); } if ( isset($_POST['twitterlink']) ) { update_post_meta( $team_id, 'twitterlink', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['twitterlink']) )) ); } if ( isset($_POST['instagram']) ) { update_post_meta( $team_id, 'instagram', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['instagram']) )) ); } if ( isset($_POST['instagramlink']) ) { update_post_meta( $team_id, 'instagramlink', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['instagramlink']) )) ); } if ( isset($_POST['linkedin']) ) { update_post_meta( $team_id, 'linkedin', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['linkedin']) )) ); } if ( isset($_POST['linkedinlink']) ) { update_post_meta( $team_id, 'linkedinlink', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['linkedinlink']) )) ); } if ( isset($_POST['pinterest']) ) { update_post_meta( $team_id, 'pinterest', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['pinterest']) )) ); } if ( isset($_POST['pinterestlink']) ) { update_post_meta( $team_id, 'pinterestlink', wp_filter_kses(sanitize_text_field( wp_unslash( $_POST['pinterestlink']) )) ); } } } //custom post type for Our Services function admire_my_custom_post_ourservices() { $labels = array( 'name' => __( 'Our Services', 'admire-extra' ), 'singular_name' => __( 'Our Services', 'admire-extra' ), 'add_new' => __( 'Add New', 'admire-extra' ), 'add_new_item' => __( 'Add New Services', 'admire-extra' ), 'edit_item' => __( 'Edit Services', 'admire-extra' ), 'new_item' => __( 'New Services', 'admire-extra' ), 'all_items' => __( 'All Services', 'admire-extra' ), 'view_item' => __( 'View Services', 'admire-extra' ), 'search_items' => __( 'Search Services', 'admire-extra' ), 'not_found' => __( 'No Services found', 'admire-extra' ), 'not_found_in_trash' => __( 'No Services found in the Trash', 'admire-extra' ), 'parent_item_colon' => '', 'menu_name' => 'Our Services' ); $args = array( 'labels' => $labels, 'description' => 'Our Services', 'public' => true, 'menu_position' => null, 'show_in_rest' => true, 'menu_icon' => 'dashicons-layout', 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ), 'rewrite' => array('slug' => 'ourservices'), 'has_archive' => true, 'exclude_from_search' => true, ); register_post_type( 'ourservices', $args ); } add_action( 'init', 'admire_my_custom_post_ourservices' ); // Shortcodes // Social Icon /*[social_area] [social icon="facebook" link="#"] [social icon="twitter" link="#"] [social icon="linkedin" link="#"] [social icon="pinterest" link="#"] [/social_area]*/ function admire_social_area($atts,$content = null){ return '
'.do_shortcode($content).'
'; } add_shortcode('social_area','admire_social_area'); function admire_social($atts){ extract(shortcode_atts(array( 'icon' => '', 'link' => '' ),$atts)); return ''; } add_shortcode('social','admire_social'); } // Footer Menu /*[footermenu menu=""]*/ function admire_foot_menu($atts, $content = null) { extract(shortcode_atts(array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'footmenu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 1, 'walker' => '', 'theme_location' => 'footer'), $atts)); return wp_nav_menu( array( 'menu' => esc_url( $menu ), 'container' => esc_url( $container ), 'container_class' => esc_attr( $container_class ), 'container_id' => esc_url( $container_id ), 'menu_class' => esc_attr( $menu_class ), 'menu_id' => esc_attr( $menu_id ), 'echo' => false, 'fallback_cb' => esc_attr( $fallback_cb ), 'before' => esc_attr( $before ), 'after' => esc_attr( $after ), 'link_before' => esc_attr( $link_before ), 'link_after' => esc_attr( $link_after ), 'depth' => esc_attr( $depth ), 'walker' => esc_attr( $walker ), 'theme_location' => esc_attr( $theme_location ))); } add_shortcode("footermenu", "admire_foot_menu"); //[clear] function admire_clear_func() { $clr = '
'; return wp_kses_post( $clr ); } add_shortcode( 'clear', 'admire_clear_func' ); //[space height="20"] function admire_space_shortcode_func($atts ) { extract( shortcode_atts( array( 'height' => '20', ), $atts ) ); $sptr = '
'; $escaping_sptr = wp_kses_post( $sptr ); return wp_kses_post( $escaping_sptr ); } add_shortcode( 'space', 'admire_space_shortcode_func' ); //[posts-style1 show='4' col='4' cat='1' excerptlength='24'] // Shortcode Post Block Style1 function admire_post_style1_func( $atts ) { global $authordata; extract( shortcode_atts( array( 'show' => '', 'col' => '', 'cat' => '', 'excerptlength' => '24', ), $atts ) ); $lbposts = '
'; $args = array( 'posts_per_page' => $show, 'cat' => $cat, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); if( $col == 1 ){ $lbposts .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : '' ).''; if ( has_post_thumbnail() ){ $lbposts .= '
'; } $lbposts .= '
'.esc_attr( get_the_date('M d, Y') ).'

'.esc_attr( get_the_title() ).'

'.wp_trim_words( wp_kses_post( get_the_content() ), esc_attr( $excerptlength )).'

'; } }else{ $lbposts .= '

Sorry! There are no posts.

'; } wp_reset_postdata(); $lbposts .= '
'; return $lbposts; } add_shortcode( 'posts-style1', 'admire_post_style1_func' ); //[posts-style2 show='2' col='2' cat='1' excerptlength='24'] // Shortcode Post Block Style2 function admire_post_style2_func( $atts ) { global $authordata; global $lbposts; extract( shortcode_atts( array( 'show' => '', 'col' => '', 'cat' => '', 'excerptlength' => '24', ), $atts ) ); $lbposts = '
'; $args = array( 'posts_per_page' => $show, 'cat' => $cat, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); if( $col == 1 ){ $lbposts .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : '' ).''; if ( has_post_thumbnail() ){ $lbposts .= '
'; } $lbposts .= '

'.get_the_title().'

'.esc_attr( get_the_author() ).' '.esc_attr( get_the_date('F j, Y') ).'

'.wp_trim_words( get_the_content(), esc_attr( $excerptlength ) ).'

'; } }else{ $lbposts .= '

Sorry! There are no post.

'; } wp_reset_postdata(); $lbposts .= ''; return $lbposts; } add_shortcode( 'posts-style2', 'admire_post_style2_func' ); // Post Style 3 //[posts-style3 show='12' col='4' cat='1' excerptlength='24'] // Shortcode Post Block Style3 function admire_post_style3_func( $atts ) { global $authordata; global $lbposts; extract( shortcode_atts( array( 'show' => '', 'col' => '', 'cat' => '', 'excerptlength' => '24', ), $atts ) ); $lbposts = '
'; $args = array( 'posts_per_page' => $show, 'cat' => $cat, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); if( $col == 1 ){ $lbposts .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : '' ).'
'; } if(has_post_thumbnail() ){ $lbposts .= '
'; } else{ $lbposts .= '
'; } $lbposts .= '

'.esc_attr( get_the_title() ).'

'; $lbposts .= '
'.wp_trim_words( wp_kses_post( get_the_content() ), esc_attr( $excerptlength ) ).'
'; $lbposts .= ''; $lbposts .= '
'; } }else{ $lbposts .= '

Sorry! There are no post.

'; } wp_reset_postdata(); $lbposts .= '
'; return $lbposts; } add_shortcode( 'posts-style3', 'admire_post_style3_func' ); // Post Style 4 //[posts-style4 show='3' col='3' excerptlength='14' cat='' buttontext='Read More'] function posts_style4_func( $atts ) { global $authordata; global $lbposts; extract( shortcode_atts( array( 'show' => '', 'col' => '', 'cat' => '', 'excerptlength' => '', 'buttontext' => '', ), $atts ) ); $lbposts = '
'; $args = array( 'posts_per_page' => $show, 'cat' => $cat, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); if( $col == 1 ){ $lbposts .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : '' ).''; if ( has_post_thumbnail() ){ $lbposts .= '
'; } $lbposts .= '

'.esc_attr( get_the_title() ).'

'.wp_trim_words( wp_kses_post( get_the_content() ), esc_attr( $excerptlength ) ).'
'; } }else{ $lbposts .= '

Sorry! There are no posts.

'; } wp_reset_postdata(); $lbposts .= '
'; return $lbposts; } add_shortcode( 'posts-style4', 'posts_style4_func' ); //[posts-timeline show="4" cat="1" excerptlength="24"] // Shortcode Post Time Line function admire_post_timeline_func( $atts ) { global $authordata; extract( shortcode_atts( array( 'show' => '4', 'cat' => '1', 'excerptlength' => '24', ), $atts ) ); $tmlposts = '
'; return $tmlposts; } add_shortcode( 'posts-timeline', 'admire_post_timeline_func' ); //[posts-grid show="4" cat="1" excerptlength="24"] // Shortcode Post Grid function admire_post_grid_func( $atts ) { global $authordata; extract( shortcode_atts( array( 'show' => '4', 'cat' => '1', 'excerptlength' => '24', ), $atts ) ); $gridposts = '
'; $args = array( 'posts_per_page' => $show, 'cat' => $cat, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { $n = 1; while ( $query->have_posts() ) { $query->the_post(); $gridposts .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : '' ).'

'.esc_attr( get_the_title() ).'

'.esc_attr( get_the_author()).' '.esc_attr( get_the_date('F j, Y') ).'

'.wp_trim_words( wp_kses_post( get_the_content() ), esc_attr( $excerptlength ) ).'

'; $n++; } }else{ $gridposts .= '

Sorry! There are no posts.

'; } wp_reset_postdata(); $gridposts .= '
'; return $gridposts; } add_shortcode( 'posts-grid', 'admire_post_grid_func' ); // Services Sidebar Menu /*[sidebar-menu menu='Services Sidebar']*/ function admire_sidebar_menu($atts, $content = null) { extract(shortcode_atts(array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'sidebar-menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 1, 'walker' => ''), $atts)); return wp_kses_post( wp_nav_menu( array( 'menu' => $menu, 'container' => $container, 'container_class' => $container_class, 'container_id' => $container_id, 'menu_class' => $menu_class, 'menu_id' => $menu_id, 'echo' => false, 'fallback_cb' => $fallback_cb, 'before' => $before, 'after' => $after, 'link_before' => $link_before, 'link_after' => $link_after, 'depth' => $depth, 'walker' => $walker)) ); } //Create the shortcode add_shortcode("sidebar-menu", "admire_sidebar_menu"); // Shortcode Services //[services_box show='8'] function admire_services_box_func( $atts ) { extract( shortcode_atts( array( 'show' => '3', ), $atts ) ); extract( shortcode_atts( array( 'show' => $show,), $atts ) ); $ourtm = ''; wp_reset_postdata(); $ourtm = '
'; $args = array( 'post_type' => 'ourservices', 'posts_per_page' => $show, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); $n = 0; if ( $query->have_posts() ) { while ( $query->have_posts() ) { $n++; $query->the_post(); $servicesiconimg = get_the_post_thumbnail_url( get_the_ID(), 'full'); $ourtm .= '
'.esc_attr( get_the_title()).''; $ourtm .= '
'; $ourtm .= '

'.esc_attr( get_the_title() ).'

'.esc_attr( get_the_excerpt() ).'

'; $ourtm .= '
'; $ourtm .= '
'; } }else{ $ourtm .= 'Sorry, Services is empty.'; } wp_reset_postdata(); $ourtm .= '
'; return $ourtm; } add_shortcode( 'services_box', 'admire_services_box_func' ); // [ourteam col='2' show='2'] function admire_ourteam_func( $atts ) { extract( shortcode_atts( array( 'col' => '', 'show' => '', 'excerptlength' => '25', ), $atts ) ); extract( shortcode_atts( array( 'show' => $show,), $atts ) ); $ourtm = ''; wp_reset_postdata(); $ourtm = '
'; $args = array( 'post_type' => 'team', 'posts_per_page' => $show, 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); $n = 0; if ( $query->have_posts() ) { while ( $query->have_posts() ) { $n++; $query->the_post(); $designation = esc_html( get_post_meta( get_the_ID(), 'designation', true ) ); $facebook = get_post_meta( get_the_ID(), 'facebook', true ); $facebooklink = get_post_meta( get_the_ID(), 'facebooklink', true ); $twitter = get_post_meta( get_the_ID(), 'twitter', true ); $twitterlink = get_post_meta( get_the_ID(), 'twitterlink', true ); $instagram = get_post_meta( get_the_ID(), 'instagram', true ); $instagramlink = get_post_meta( get_the_ID(), 'instagramlink', true ); $linkedin = get_post_meta( get_the_ID(), 'linkedin', true ); $linkedinlink = get_post_meta( get_the_ID(), 'linkedinlink', true ); $pinterest = get_post_meta( get_the_ID(), 'pinterest', true ); $pinterestlink = get_post_meta( get_the_ID(), 'pinterestlink', true ); if( $col == 1 ){ $ourtm .= '
'.( (get_the_post_thumbnail( get_the_ID(), 'thumbnail') != '') ? get_the_post_thumbnail( get_the_ID(), 'full') : 'teamimage' ).'
'; $ourtm .= '

'.esc_attr( get_the_title()).'

'; if( $designation != '' ){ $ourtm .= '
'.esc_attr( $designation ).'
'; } $ourtm .= '
'; } } wp_reset_postdata(); $ourtm .= '
'; return $ourtm; } add_shortcode( 'ourteam', 'admire_ourteam_func' ); // Testimonial Box // [testimonials-box col="3" show="3"] function admire_testimonials_box_func( $atts ) { extract( shortcode_atts( array( 'col' => '3', 'show' => '3', ), $atts ) ); extract( shortcode_atts( array( 'show' => $show,), $atts ) ); $tstmnl = ''; wp_reset_postdata(); $tstmnl = '
'; $args = array( 'post_type' => 'testimonials', 'posts_per_page' => $show, 'orderby' => 'date', 'order' => 'desc' ); $query = new WP_Query( $args ); $n = 0; if ( $query->have_posts() ) { while ( $query->have_posts() ) { $n++; $query->the_post(); $companyname = esc_html( get_post_meta( get_the_ID(), 'companyname', true ) ); $possition = esc_html( get_post_meta( get_the_ID(), 'possition', true ) ); if( $col == 1 ){ $tstmnl .= '

'.esc_attr( get_the_title() ).'

'; $tstmnl .= ''; if(!empty($companyname)){ $tstmnl .= esc_html( $companyname ); } $tstmnl .= '
'; if(!empty($possition)){ $tstmnl .= esc_html( $possition ); } $tstmnl .= '
'; $tstmnl .= '
'; } }else{ $tstmnl .= '
Sed suscipit mauris nec mauris vulputate, a posuere libero ongue. Nam laoreet elit eu erat pulvinar, et efficitur nibh imod. Proin venenatis orci sit amet nisl finibus vehicula. Nam metus lorem, hendrerit quis ante eget lobortis eleneque. Aliquam in ullamcorper quam. Integer euismod ligula in mauris vehicula imperdiet.

John,

(Company Name, CEO)
Sed suscipit mauris nec mauris vulputate, a posuere libero ongue. Nam laoreet elit eu erat pulvinar, et efficitur nibh imod. Proin venenatis orci sit amet nisl finibus vehicula. Nam metus lorem, hendrerit quis ante eget lobortis eleneque. Aliquam in ullamcorper quam. Integer euismod ligula in mauris vehicula imperdiet.

Stefen,

(Company Name, Sr.Manager)
Sed suscipit mauris nec mauris vulputate, a posuere libero ongue. Nam laoreet elit eu erat pulvinar, et efficitur nibh imod. Proin venenatis orci sit amet nisl finibus vehicula. Nam metus lorem, hendrerit quis ante eget lobortis eleneque. Aliquam in ullamcorper quam. Integer euismod ligula in mauris vehicula imperdiet.

Sara,

(Company Name, Developer)
'; } wp_reset_postdata(); $tstmnl .= ''; return $tstmnl; } add_shortcode( 'testimonials-box', 'admire_testimonials_box_func' ); //[testimonial-slider limit='-1'] function admire_testimonial_slider_func( $atts ) { extract( shortcode_atts( array( 'limit' => '-1' ), $atts ) ); ob_start(); ?> '-1' ), $atts ) ); ob_start(); ?>