Advertisement
Guest User

post-loop.php

a guest
Nov 27th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.71 KB | None | 0 0
  1. <!-- Charisma: posts-loop.php -->
  2.  
  3. <?php if (is_search()) { ?>
  4.     <h1 class="page_title"><?php _e('Search results for ','theme'); echo ' "'.$s.'"'; ?></h1>
  5. <?php }  ?>
  6. <?php if (is_author()) { ?>
  7. <?php
  8. $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
  9. ?>
  10.     <h1 class="page_title"><?php _e('Written by: "'.$curauth->display_name.'"','theme'); ?></h1>
  11. <?php }  ?>
  12. <?php if (is_archive()) {
  13.         $term = $wp_query->get_queried_object();
  14.         $taxonomy = get_taxonomy( $term->taxonomy );
  15. ?>
  16.  
  17. <?php if (is_category()) { ?>
  18.     <h1 class="page_title"><?php _e('Category: ', 'theme'); echo $term->name; ?></h1>
  19. <?php }  ?>
  20. <?php if (is_tag()) { ?>
  21.     <h1 class="page_title"><?php _e('Tagged by: ', 'theme'); echo $term->name; ?></h1>
  22. <?php }  ?>
  23.  
  24. <?php if (is_date() ) { ?>
  25.  
  26. <h1 class="page_title"><?php _e('Archives for: ', 'theme'); ?>
  27.     <?php   if ( is_day() )
  28.                 echo get_the_time( 'F j, Y' );
  29.  
  30.             elseif ( is_month() )
  31.                 echo single_month_title( ' ', false );
  32.  
  33.             elseif ( is_year() )
  34.                 echo get_the_time( 'Y' );
  35.     }
  36.     ?>
  37. </h1>
  38. <?php }  ?>
  39.  
  40. <?php if ( have_posts() ) : while ( have_posts() ) : the_post();
  41. $post_format = get_post_format();
  42. $hide_feature = get_post_meta($post->ID, 'mom_hide_fi', true);
  43. global $posts_st;
  44. $extra = get_post_meta(get_the_ID(), $posts_st->get_the_id(), TRUE);
  45. if (isset($extra['aside_embed'])) { $aside_embed = $extra['aside_embed']; }
  46. if (isset($extra['status_embed'])) { $status_embed = $extra['status_embed']; }
  47. if (isset($extra['link_url'])) { $link_url = $extra['link_url']; }
  48.  
  49. ?>
  50.                                 <article <?php post_class('chr_post');?>>
  51.                 <?php if ($post_format != 'aside' && $post_format != 'status' && $post_format != 'link') { ?>
  52.                                 <div class="post_title_wrap">
  53.                 <?php if(is_single()) { ?>
  54.                                 <h2 class="post_title"><?php the_title(); ?></h2>
  55.                 <?php } else { ?>
  56.                                 <h2 class="post_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  57.                 <?php } ?>
  58.                                 <?php if (mom_option('disable_post_format') != true) { ?>
  59.                 <span class="post_type"></span>
  60.                 <?php } ?>
  61.                                 </div>
  62.                 <?php } else { ?>
  63.                                 <?php if (mom_option('disable_post_format') != true) { ?>
  64.                 <span class="post_type"></span>
  65.                 <?php } ?>
  66.                 <?php } ?>
  67.                                 <div class="post_content">
  68.                                 <?php
  69.                 if ($post_format != 'gallery' && $post_format != 'video') {
  70.                                 if ($hide_feature != true) {
  71.                                 if ( has_post_thumbnail() ) {
  72.                                     the_post_thumbnail();
  73.                                     }
  74.                                 }
  75.                 }
  76.                                 ?>
  77.                                     <?php if ($post_format == 'audio') { ?>
  78.                                         <?php get_template_part('post', 'audio'); ?>
  79.                                     <?php } elseif ($post_format == 'video') { ?>
  80.                                         <?php get_template_part('post', 'video'); ?>
  81.                                     <?php } elseif ($post_format == 'quote') { ?>
  82.                                      <blockquote class="quote_post">
  83.                                         <a href="<?php the_permalink(); ?>"><?php the_content(false); ?></a>
  84.                                     </blockquote>
  85.                                     <?php } elseif ($post_format == 'aside') { ?>
  86.                     <?php if (!empty($aside_embed)) { ?>
  87.                     <div class="embed_notes_wrap">
  88.                         <?php echo $aside_embed; ?>
  89.                     </div>
  90.                     <?php } else { ?>
  91.                     <div class="mom_post_note border-box">
  92.                         <?php the_content(false); ?>
  93.                     </div>
  94.                     <div class="mom_note_shadow mom_visibility_desktop"></div>
  95.                     <?php } ?>
  96.                     <?php } elseif ($post_format == 'status') { ?>
  97.                     <?php if (!empty($status_embed)) { ?>
  98.                     <div class="embed_notes_wrap">
  99.                         <?php echo $status_embed; ?>
  100.                     </div>
  101.                     <?php } else { ?>
  102.                     <div class="mom_post_note border-box">
  103.                         <?php the_content(false); ?>
  104.                     </div>
  105.                     <div class="mom_note_shadow mom_visibility_desktop"></div>
  106.                     <?php } ?>
  107.                     <?php } elseif ($post_format == 'link') { ?>
  108.                     <div class="link_post">
  109.                     <h2 class="the_link"><a href="<?php echo $link_url; ?>" target="_blank"><?php the_title(); ?></a></h2>
  110.                     <?php the_content(false); ?>
  111.                     </div>
  112.                    
  113.                     <?php }  elseif ($post_format == 'chat') { ?>
  114.                     <?php the_content(false); ?>
  115.                                     <?php if (!is_single()) { ?>
  116.                                    
  117.                                     <?php } ?>
  118.                    
  119.                     <?php } elseif ($post_format == 'gallery') { ?>
  120.                                         <?php get_template_part('post', 'gallery'); ?>
  121.                                     <?php } ?>
  122.                                     <?php if ($post_format != 'quote' && $post_format != 'aside' && $post_format != 'status' && $post_format != 'link' && $post_format != 'chat') { ?>
  123.                                     <div class="mom_visibility_desktop">
  124.                     <?php if (is_search()) { ?>
  125.                         <?php
  126.                         $excerpt = strip_shortcodes(get_the_content());
  127.                         echo '<p>'.wp_html_excerpt($excerpt, 250, '...').'</p>';
  128.                         ?>
  129.                     <?php } else { ?>
  130.                         <?php the_content(false); ?>
  131.                     <?php } ?>
  132.                                     </div>
  133.                                     <div class="mom_visibility_mobile">
  134.                 <?php if (!is_single()) { ?>
  135.                     <?php
  136.                                             $excerpt = strip_shortcodes(get_the_content());
  137.                                             echo '<p>'.wp_html_excerpt($excerpt, 120, '...').'</p>';
  138.                                         ?>
  139.                 <?php } else { ?>
  140.                         <?php the_content(false); ?>
  141.                 <?php } ?>
  142.                                     </div>
  143.                                     <?php if (!is_single()) { ?>
  144.                                    
  145.                                     <?php } ?>
  146.                                     <?php } ?>
  147.                     <?php wp_link_pages(); ?>
  148.                                 </div><!--End Post Content-->
  149.                                 <div class="clear"></div>
  150.                                 <?php if (is_single()) { ?>
  151.                                     <?php if (has_tag()) { ?>
  152.                                     <div class="post_tags">
  153.                                         <?php the_tags('', ', ', ''); ?>
  154.                                     </div><!--End Post Tags-->
  155.                                     <?php } ?>
  156.                                 <?php } ?>
  157.                 <?php if ($post_format != 'aside' && $post_format != 'status' && $post_format != 'link') { ?>
  158.                                 <div class="post_meta">
  159.                                     <span class="admin">
  160.                                     <?php
  161.         $author_name = get_the_author_meta('nickname');
  162.          if(function_exists('icl_register_string')) {
  163.             icl_register_string('Author', 'author name', get_the_author_meta('nickname'));
  164.             $author_name = icl_t('Author', 'author name', get_the_author_meta('nickname'));
  165.          }                 
  166.                 ?>
  167.                     <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php echo $author_name; ?></a>
  168.                     </span>
  169.                                     <span class="date"><?php the_time(mom_option('date_format')); ?></span>
  170.                                     <span class="comment_count mom_visibility_desktop">
  171.                                         <a href="<?php comments_link(); ?>"><?php comments_number(__('No Comments', 'theme'), __('1 Comment', 'theme'), __('% Comments', 'theme')); ?></a>
  172.                                     </span>
  173.                                     <span class="comment_count mom_visibility_mobile last">
  174.                                         <a href="<?php comments_link(); ?>"><?php comments_number(0, __('1', 'theme'), __('%', 'theme')); ?></a>
  175.                                     </span>
  176.                                     <?php if(function_exists('the_views')) { ?><span class="views"><?php _e('Views: ','theme'); ?><?php the_views(); ?></span><?php } ?>
  177.                                     <span class="cat"><?php the_category(', '); ?></span>
  178.                                     <div class="clear"></div>
  179.                                 </div> <!--End Post Meta-->
  180.                 <?php } ?>
  181.                             </article><!--End Post-->
  182. <?php endwhile; else: ?>
  183. <p class="noposts"><?php _e('Sorry, no posts matched your criteria.', 'theme'); ?></p>
  184. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement