OwlCyberSecurity - MANAGER
Edit File: doctors-listing.php
<?php /** * Doctors List */ add_shortcode( 'pearl_doctors_list', 'pearl_doctors_list' ); function pearl_doctors_list( $atts ) { extract( shortcode_atts( array( 'number_of_posts' => 3, 'style' => 'multiple', 'department' => '', ), $atts ) ); ob_start(); $doctors_args = array( 'post_type' => 'doctor', 'posts_per_page' => $number_of_posts, ); if ( ! empty( $department ) ) { $departments = explode( ',', $department ); $taxonomy = array( array( 'taxonomy' => 'doctor-department', 'field' => 'department', 'terms' => $departments, ), ); $doctors_args['tax_query'] = $taxonomy; } $doctors = new WP_Query( $doctors_args ); if ( $style == 'single' ) { ?> <div class="member-detail"> <div class="container"> <div id="team-detail" class="owl-carousel"> <?php if ( $doctors->have_posts() ) { while ( $doctors->have_posts() ) { $doctors->the_post(); $meta_data = get_post_custom(); ?> <div class="post item"> <div class="col-md-5"> <div class="gallery-sec"> <div class="image-hover img-layer-slide-left-right"> <?php if ( has_post_thumbnail() ) : the_post_thumbnail( 'pearl_image_size_762_700', true ); endif; ?> <div class="layer"> <?php if ( ! empty( $meta_data['PEARL_META_facebook_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_facebook_url'][0] . '" target="_blank"><i class="icon-euro"></i></a> '; endif; if ( ! empty( $meta_data['PEARL_META_twitter_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_twitter_url'][0] . '" target="_blank"><i class="icon-yen"></i></a> '; endif; if ( ! empty( $meta_data['PEARL_META_google_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_google_url'][0] . '" target="_blank"><i class="icon-caddieshoppingstreamline"></i></a> '; endif; ?> </div> </div> </div> </div> <div class="col-md-7"> <div class="team-detail"> <div class="name"> <h6><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6> <span><?php the_terms( get_the_ID(), 'doctor-department', ' ', ', ', ' ' ); ?></span> </div> <ul> <?php if ( ! empty( $meta_data['PEARL_META_speciality'] ) ) : echo '<li><span class="title">' . esc_html__( 'Speciality', 'pearl-medical-framework' ) . '</span> <span>' . $meta_data['PEARL_META_speciality'][0] . '</span></li>'; endif; if ( ! empty( $meta_data['PEARL_META_degree'] ) ) : echo '<li><span class="title">' . esc_html__( 'Degrees', 'pearl-medical-framework' ) . '</span> <span>' . $meta_data['PEARL_META_degree'][0] . '</span></li>'; endif; if ( ! empty( $meta_data['PEARL_META_experience'] ) ) : echo '<li><span class="title">' . esc_html__( 'Experience', 'pearl-medical-framework' ) . '</span> <span>' . $meta_data['PEARL_META_experience'][0] . '</span></li>'; endif; if ( ! empty( $meta_data['PEARL_META_training'] ) ) : echo '<li><span class="title">' . esc_html__( 'Training', 'pearl-medical-framework' ) . '</span> <span>' . $meta_data['PEARL_META_training'][0] . '</span></li>'; endif; if ( ! empty( $meta_data['PEARL_META_work_days'] ) ) : echo '<li><span class="title">' . esc_html__( 'Work days', 'pearl-medical-framework' ) . '</span> <span>' . $meta_data['PEARL_META_work_days'][0] . '</span></li>'; endif; ?> </ul> </div> </div> </div> <?php } } ?> </div> </div> </div> <?php } else { ?> <div class="meet-specialists"> <div class="container"> <div id="owl-demo4" class="owl-carousel"> <?php if ( $doctors->have_posts() ) { while ( $doctors->have_posts() ) { $doctors->the_post(); $meta_data = get_post_custom(); ?> <div class="post item"> <div class="gallery-sec"> <div class="image-hover img-layer-slide-left-right"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'pearl_image_size_762_700' ); } ?> <div class="layer"> <?php if ( ! empty( $meta_data['PEARL_META_facebook_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_facebook_url'][0] . '" target="_blank"><i class="icon-euro"></i></a> '; endif; if ( ! empty( $meta_data['PEARL_META_twitter_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_twitter_url'][0] . '" target="_blank"><i class="icon-yen"></i></a> '; endif; if ( ! empty( $meta_data['PEARL_META_google_url'] ) ) : echo '<a href="' . $meta_data['PEARL_META_google_url'][0] . '" target="_blank"><i class="icon-caddieshoppingstreamline"></i></a> '; endif; ?> </div> </div> </div> <div class="detail"> <h6><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6> <span><?php the_terms( get_the_ID(), 'doctor-department', ' ', ', ', ' ' ); ?></span> <p><?php the_pearl_excerpt( 18 ) ?></p> <a href="<?php the_permalink(); ?>"><?php esc_html_e( '- View Profile', 'pearl-medical-framework' ); ?></a> </div> </div> <?php } } ?> </div> </div> </div> <?php } return ob_get_clean(); } /** * Doctors List */ $get_terms = get_terms( 'doctor-department', array( 'orderby' => 'count', 'hide_empty' => 0 ) ); $doctor_department = array(); if ( ! empty( $get_terms ) && ! is_wp_error( $get_terms ) ) { foreach ( $get_terms as $term ) { $doctor_department[ $term->name ] = $term->term_id; } } vc_map( array( "name" => esc_html__( "Pearl Doctors", 'pearl-medical-framework' ), "base" => "pearl_doctors_list", "class" => "", "category" => esc_html__( "MedicalGuide Theme", 'pearl-medical-framework' ), "params" => array( array( "type" => "dropdown", "class" => "", "heading" => esc_html__( "Number of Doctors to display", 'pearl-medical-framework' ), "param_name" => "number_of_posts", "value" => array( 3, 6, 9, 12 ), "description" => esc_html__( "Select a number of doctors posts you want to display.", 'pearl-medical-framework' ), "admin_label" => true ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__( "Style", 'pearl-medical-framework' ), "param_name" => "style", "value" => array( 'Multiple' => 'multiple', 'Single' => 'single' ), "admin_label" => true ), array( "type" => "checkbox", "class" => "", "heading" => esc_html__( "Departments", 'pearl-medical-framework' ), "param_name" => "department", "value" => $doctor_department, "admin_label" => true ), ) ) );