Guest User

Untitled

a guest
Sep 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. <div class="grid-container grid-x">
  2. <div class="<?php if(is_active_sidebar('left-sidebar')) echo 'cell large-9'?> content page_content grid-x">
  3. <div class="small-12 category_title">
  4. <span class="h1"><i class="fa fa-ellipsis-h" aria-hidden="true"></i> <?php
  5.  
  6. $category = get_the_category();
  7. echo $category[0]->cat_name;
  8. ?></span>
  9. <?php breadcrumbs(); ?>
  10. </div>
  11. <div class="content">
  12. <?php if ( have_posts() ) while ( have_posts() ) : the_post();?>
  13. <div class="cell small-12 meta">
  14. <h1><?php the_title();?></h1>
  15. <?php
  16. $autor= get_post_meta(get_the_id(),'author_select',true); //получаем переменную телефона с главной странице
  17.  
  18. $authors = get_field('author_list', 'option');
  19. foreach ($authors as $key => $value) {
  20. if ($authors[$key]['fio'] == $autor) {
  21. $autor_url = $authors[$key]['author_page'];
  22. }
  23. }
  24.  
  25. ?> <span class="date">Автор</span><span class="Autor" style="color: #007bff"><a href="<?=$autor_url;?>"><?php echo $autor; ?></a></span>
  26. <span class="date">Дата обновления: <?php the_time("d M"); ?></span>
  27. <?php /*<span class="comments_count"><?php echo get_comments_number()?><i class="fa fa-comments-o" aria-hidden="true"></i></span>
  28. <span class="post_views"><?php echo do_shortcode('[post-views]');?><i class="fa fa-eye" aria-hidden="true"></i></span> */ ?>
  29. </div>
  30. <div class="cell small-12">
  31. <?php the_content();?>
  32.  
  33. </div>
  34.  
  35. <div class="clearfix"></div>
  36.  
  37. <div class="cell small-12 info_for_user">
  38. <div class="info"><?php socials_webnavoz_Plugin(); ?>
  39.  
  40. Все материалы на сайте представлены только в ознакомительных целях и не являются инструкцией по самолечению. Обязательно обратитесь к врачу за квалифицированной медицинской помощью!!!
  41. </div>
  42. </div>
  43.  
  44. <?php
  45. $post_id = get_the_ID();
  46.  
  47. global $wpdb;
  48. $prefix = $wpdb->prefix;
  49. $table = $prefix.'site_authors';
  50. $table2 = $prefix.'authors_posts';
  51.  
  52. $post_author_id = $wpdb->get_results("SELECT * FROM `".$table2."` WHERE `post_id`=$post_id", 'ARRAY_A');
  53. $post_author_id = $post_author_id[0]['author_id'];
  54. $author_info = $wpdb->get_results("SELECT * FROM `".$table."` WHERE `fio`='$post_author_id'", 'ARRAY_A');
  55. $author_info = $author_info[0];
  56.  
  57. $name = $author_info['fio'];
  58.  
  59. $author_posts = $wpdb->get_results("SELECT * FROM `".$table2."` WHERE `author_id`='$name'", 'ARRAY_A');
  60. if($post_author_id != ''){
  61. ?>
  62.  
  63. <div class="author_box grid-x">
  64. <div class="title_box cell small-12 dgreen">
  65. <h4><i class="fa fa-pencil" aria-hidden="true"></i>Автор статьи</h4>
  66. </div>
  67. <div class="author_content grid-x align-middle cell small-12">
  68. <div class="cell small-12 medium-2 avatar">
  69. <div class="image" style="background-image: url('<?php echo $author_info['image']?>');"></div>
  70. </div>
  71. <div class="cell small-12 medium-3 author_name">
  72. <p class="name"><?php echo $author_info['fio']; ?></p>
  73. <span class="status">(<?php echo $author_info['position']; ?>)</span>
  74. </div>
  75. <div class="cell small-12 medium-3 author_meta">
  76. <p class="text"><i class="fa fa-address-card" aria-hidden="true"></i> <b>Стаж: </b><?php echo $author_info['stage']; ?></p>
  77. <p class="text"><i class="fa fa-folder" aria-hidden="true"></i> <b>Публикаций: </b><?php echo count($author_posts); ?></p>
  78. </div>
  79. <div class="cell small-12 medium-4 author_link">
  80. <a class="btn pink_btn read_more" href="<?php echo $author_info['author_page'] ?>">Подробнее <i class="fa fa-caret-right" aria-hidden="true"></i></a>
  81. </div>
  82. </div>
  83. </div>
  84.  
  85. <?php
  86. }
  87. endwhile;?>
  88. <?php if (comments_open() || get_comments_number()) comments_template('', true);?>
  89. </div>
  90. </div>
  91. <?php get_sidebar();?>
  92. </div>
Add Comment
Please, Sign In to add comment