Advertisement
Shockrate

Ultimate Post Widget - Centro Pastore

Sep 25th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. /*
  2. =============================================
  3. ULTIMATE POST WIDGET CODE
  4. =============================================
  5.  
  6. Andare su FileZilla
  7. Percorso: /lamp0/web/vhosts/www.centropastore.it/htdocs/wp-content/plugins/ultimate-posts-widget/templates
  8. File da modificare: legacy.php
  9. */
  10. <?php
  11. /**
  12. * Legacy template for compatibility with versions prior to 2.0.0
  13. *
  14. * @version 2.0.0
  15. */
  16. ?>
  17.  
  18. <?php if ($instance['before_posts']) : ?>
  19. <div class="upw-before">
  20. <?php echo wpautop($instance['before_posts']); ?>
  21. </div>
  22. <?php endif; ?>
  23. <?php if ($upw_query->have_posts()) : ?>
  24.  
  25. <?php while ($upw_query->have_posts()) : $upw_query->the_post(); ?>
  26.  
  27. <div class="table-resp">
  28. <?php $current_post = ($post->ID == $current_post_id && is_single()) ? 'current-post-item' : ''; ?>
  29.  
  30. <?php echo ($post->ID == $current_post_id && is_single())?'current-post-item':'' ?>
  31.  
  32. <?php if (current_theme_supports('post-thumbnails') && $instance['show_thumbnail'] && has_post_thumbnail()) : ?>
  33.  
  34. <div class="upw-content"><div class="tab-img">
  35. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
  36. <?php the_post_thumbnail($instance['thumb_size']); ?>
  37. </a></div>
  38.  
  39. <?php endif; ?>
  40.  
  41.  
  42. <?php if (get_the_title() && $instance['show_title']) : ?>
  43. <p class="post-title">
  44. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
  45. <?php the_title(); ?>
  46. </a>
  47. </p>
  48. <?php endif; ?>
  49.  
  50. <?php if ($instance['show_date']) : ?>
  51. <p class="post-date">
  52. <?php the_time($instance['date_format']); ?>
  53. </p>
  54. <?php endif; ?>
  55.  
  56. <?php if ($instance['show_author']) : ?>
  57. <p class="post-author">
  58. <span class="post-author-label"><?php _e('By', 'upw'); ?>:</span>
  59. <?php the_author_posts_link(); ?>
  60. </p>
  61. <?php endif; ?>
  62.  
  63. <?php if ($instance['show_comments']) : ?>
  64. <p class="post-comments">
  65. <?php comments_number(__('No responses', 'upw'), __('One response', 'upw'), __('% responses', 'upw')); ?>
  66. </p>
  67. <?php endif; ?>
  68.  
  69. <?php if ($instance['show_excerpt']) : ?>
  70. <?php
  71. $linkmore = '';
  72. if ($instance['show_readmore']) {
  73. $linkmore = ' <a href="'.get_permalink().'" class="more-link">'.$excerpt_readmore.'</a>';
  74. }
  75. ?>
  76. <p class="post-excerpt"><?php echo get_the_excerpt() . $linkmore; ?></p>
  77. <?php endif; ?>
  78.  
  79. <?php if ($instance['show_content']) : ?>
  80. <p class="post-content"><?php the_content() ?></p>
  81. <?php endif; ?>
  82.  
  83. <?php
  84. $categories = get_the_term_list($post->ID, 'category', '', ', ');
  85. if ($instance['show_cats'] && $categories) :
  86. ?>
  87. <p class="post-cats">
  88. <span class="post-cats-label"><?php _e('Categories', 'upw'); ?>:</span>
  89. <span class="post-cats-list"><?php echo $categories; ?></span>
  90. </p>
  91. <?php endif; ?>
  92.  
  93. <?php
  94. $tags = get_the_term_list($post->ID, 'post_tag', '', ', ');
  95. if ($instance['show_tags'] && $tags) :
  96. ?>
  97. <p class="post-tags">
  98. <span class="post-tags-label"><?php _e('Tags', 'upw'); ?>:</span>
  99. <span class="post-tags-list"><?php echo $tags; ?></span>
  100. </p>
  101. <?php endif; ?>
  102.  
  103. <?php if ($custom_fields) {
  104. $custom_field_name = explode(',', $custom_fields);
  105. foreach ($custom_field_name as $name) {
  106. $name = trim($name);
  107. $custom_field_values = get_post_meta($post->ID, $name, true);
  108. if ($custom_field_values) {
  109. echo '<p class="post-meta post-meta-'.$name.'">';
  110. if (!is_array($custom_field_values)) {
  111. echo $custom_field_values;
  112. } else {
  113. $last_value = end($custom_field_values);
  114. foreach ($custom_field_values as $value) {
  115. echo $value;
  116. if ($value != $last_value) echo ', ';
  117. }
  118. }
  119. echo '</p>';
  120. }
  121. }
  122. } ?>
  123.  
  124. </div>
  125.  
  126. </div>
  127.  
  128. <?php endwhile; ?>
  129.  
  130.  
  131. <?php else : ?>
  132.  
  133. <p><?php _e('No posts found.', 'upw'); ?></p>
  134.  
  135. <?php endif; ?>
  136.  
  137. <?php if ($instance['after_posts']) : ?>
  138. <div class="upw-after">
  139. <?php echo wpautop($instance['after_posts']); ?>
  140. </div>
  141. <?php endif; ?>
  142.  
  143. /*
  144. ====================================================
  145. ULTIMATE POST CSS
  146. ====================================================
  147. */
  148.  
  149. .table-resp {
  150. max-width: 464px;
  151. display: inline-table;
  152. margin-right: 40px;
  153. margin-left: 22px;
  154. }
  155.  
  156. .upw-content {
  157. margin-top: -2px;
  158. }
  159.  
  160. .tab-img {
  161. float: left;
  162. margin-right: 18px;
  163. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement