Example #1
0
    <div class="page-contents wrap">
        <div class="header-group">
            <h1>Врачи и персонал</h1>
        </div>

    <div class="personal-and-doctors"><ul>
        <?php 
if (have_posts()) {
    ?>
            <?php 
    while (have_posts()) {
        ?>
                <?php 
        the_post();
        echo fx_doc_html($post);
        ?>
            <?php 
    }
    ?>
        <?php 
} else {
    ?>
            <p>Докторов не найдено</p>
        <?php 
}
?>
    </ul></div>
        <div class="pagination">
            <?php 
global $wp_query;
Example #2
0
function fx_doctors_shortcode($atts, $content)
{
    extract(shortcode_atts(array('ids' => 'null'), $atts));
    if ($ids == 'null') {
        return '';
    }
    $ids_array = explode(',', $ids);
    $ids_array_checked = array();
    //check array
    foreach ($ids_array as $val) {
        if (is_numeric($val)) {
            array_push($ids_array_checked, $val);
        }
    }
    $new_query = array('orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => 99, 'post_type' => 'doctor', 'post__in' => $ids_array_checked);
    $docs = get_posts($new_query);
    /*
        $rt = '<div class="service-ultra-noise"><ul class="qual-person">';
    
        foreach ($docs as $doc){
            $rt .= '<li>';
    
            if (has_post_thumbnail($doc->ID)){
                $rt.=  get_the_post_thumbnail($doc->ID, 'thumbnail');
            }else{
                $rt.=  '<img src="'.get_bloginfo('template_directory').'/img/avatar150.png" alt="">';
            }
    
            $rt .= '<div class="proffesional-info">';
            $rt.= '<a href="'.$doc->guid.'">';
    
            $custom = get_post_custom($doc->ID);
    
            $name = explode(' ', $doc->post_title);
    
            $rt .= '<strong>'.$name[0].'</strong>';
            $rt .= '<p>'.$name[1].' '.$name[2].'</p>';
    
            $rt.= '</a>';
    
            if($custom['fx_doc_specialty'][0] != ''){
                $rt .= '<strong>Специальность и категория:</strong>';
                $rt .= '<p>'.$custom['fx_doc_specialty'][0].'</p>';
            }
            $rt .= '</div>';
            $rt .= '</li>';
        }
    
        $rt .= '</ul></div>';
    */
    $rt = '<div class="personal-and-doctors"><ul>';
    foreach ($docs as $doc) {
        $rt .= fx_doc_html($doc);
    }
    $rt .= "</ul></div>";
    return $rt;
}