Advertisement
Guest User

author.php

a guest
Jul 1st, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.18 KB | None | 0 0
  1. <?php
  2. /*  ----------------------------------------------------------------------------
  3. the author template
  4. /public_html/wp-content/themes/newspaper/author.php
  5.  */
  6.  
  7. get_header();
  8.  
  9. //set the template id, used to get the template specific settings
  10. $template_id = 'author';
  11.  
  12. //prepare the loop variables
  13. global $loop_module_id, $loop_sidebar_position, $part_cur_auth_obj;
  14. $loop_module_id = td_util::get_option('tds_' . $template_id . '_page_layout', 1); //module 1 is default
  15. $loop_sidebar_position = td_util::get_option('tds_' . $template_id . '_sidebar_pos'); //sidebar right is default (empty)
  16.  
  17. // sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue
  18. $td_sidebar_position = '';
  19. if($loop_sidebar_position == 'sidebar_left') {
  20.     $td_sidebar_position = 'td-sidebar-left';
  21. }
  22. //read the current author object - used by here in title and by /parts/author-header.php
  23. $part_cur_auth_obj = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
  24.  
  25.  
  26. //set the global current author object, used by widgets (author widget)
  27. td_global::$current_author_obj = $part_cur_auth_obj;
  28.  
  29. ?>
  30.  
  31. <div class="td-main-content-wrap td-container-wrap">
  32.     <div class="td-container <?php echo $td_sidebar_position; ?>">
  33.         <div class="td-crumb-container">
  34.             <?php echo td_page_generator::get_author_breadcrumbs($part_cur_auth_obj); // generate the breadcrumbs ?>
  35.         </div>
  36.         <div class="td-pb-row">
  37.             <?php
  38.             switch ($loop_sidebar_position) {
  39.  
  40.                 /*  ----------------------------------------------------------------------------
  41.                     This is the default option
  42.                     If you set the author template with the right sidebar the theme will use this part
  43.                 */
  44.                 default:
  45.                     ?>
  46.                         <div class="td-pb-span8 td-main-content">
  47.                             <div class="td-ss-main-content">
  48.                                 <div class="td-page-header">
  49.                                     <h1 class="entry-title td-page-title">
  50.                                         <span><?php echo $part_cur_auth_obj->display_name; ?></span>
  51.                                     </h1>
  52.                                 </div>
  53.  
  54.                                 <?php
  55.                                 //load the author box located in - parts/page-author-box.php - can be overwritten by the child theme
  56.                                 locate_template('parts/page-author-box.php', true);
  57.                                 ?>
  58.  
  59.                                 <?php locate_template('loop.php', true);?>
  60.  
  61.                                 <?php echo td_page_generator::get_pagination(); // the pagination?>
  62.                             </div>
  63.                         </div>
  64.                         <div class="td-pb-span4 td-main-sidebar">
  65.                             <div class="td-ss-main-sidebar">
  66.                                 <?php get_sidebar(); ?>
  67.                             </div>
  68.                         </div>
  69.                     <?php
  70.                     break;
  71.  
  72.  
  73.  
  74.                 /*  ----------------------------------------------------------------------------
  75.                     If you set the author template with sidebar left the theme will render this part
  76.                 */
  77.                 case 'sidebar_left':
  78.                     ?>
  79.                         <div class="td-pb-span8 td-main-content <?php echo $td_sidebar_position; ?>-content">
  80.                             <div class="td-ss-main-content">
  81.                                 <div class="td-page-header">
  82.                                     <h1 class="entry-title td-page-title">
  83.                                         <span><?php echo $part_cur_auth_obj->display_name; ?></span>
  84.                                     </h1>
  85.                                 </div>
  86.  
  87.                                 <?php
  88.                                 //load the author box located in - parts/page-author-box.php - can be overwritten by the child theme
  89.                                 locate_template('parts/page-author-box.php', true);
  90.                                 ?>
  91.  
  92.                                 <?php locate_template('loop.php', true);?>
  93.  
  94.                                 <?php echo td_page_generator::get_pagination(); // the pagination?>
  95.                             </div>
  96.                         </div>
  97.                         <div class="td-pb-span4 td-main-sidebar">
  98.                             <div class="td-ss-main-sidebar">
  99.                                 <?php get_sidebar(); ?>
  100.                             </div>
  101.                         </div>
  102.                     <?php
  103.                     break;
  104.  
  105.  
  106.  
  107.                 /*  ----------------------------------------------------------------------------
  108.                     If you set the author template with no sidebar the theme will use this part
  109.                 */
  110.                 case 'no_sidebar':
  111.                     ?>
  112.                         <div class="td-pb-span12 td-main-content">
  113.                             <div class="td-ss-main-content">
  114.                                 <div class="td-page-header">
  115.                                     <h1 class="entry-title td-page-title">
  116.                                         <span><?php echo $part_cur_auth_obj->display_name; ?></span>
  117.                                     </h1>
  118.                                 </div>
  119.  
  120.                                 <?php
  121.                                 //load the author box located in - parts/page-author-box.php - can be overwritten by the child theme
  122.                                 locate_template('parts/page-author-box.php', true);
  123.                                 ?>
  124.  
  125.                                 <?php locate_template('loop.php', true);?>
  126.  
  127.                                 <?php echo td_page_generator::get_pagination(); // the pagination?>
  128.                             </div>
  129.                         </div>
  130.                     <?php
  131.                     break;
  132.             }
  133.             ?>
  134.         </div> <!-- /.td-pb-row -->
  135.     </div> <!-- /.td-container -->
  136. </div> <!-- /.td-main-content-wrap -->
  137.  
  138. <?php
  139. get_footer();
  140. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement