PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/depo-masthead/home.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 87 lines | 70 code | 15 blank | 2 comment | 20 complexity | cb525e0ad97acb0da6ccfaebbff58ed2 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php get_header(); ?>
  2. <script type="text/javascript" charset="utf-8">
  3. /*<![CDATA[ */
  4. <?php if($_GET['preview']) : ?> setTimeout( function(){ depo_init(); }, 2000); <?php endif; ?>
  5. jQuery(document).ready(depo_init);
  6. function depo_init() {
  7. var biggest = 0,
  8. entry_height = 0;
  9. jQuery('#content .post').each(function() {
  10. element = jQuery(this).attr('clientHeight');
  11. if(element > biggest) {
  12. biggest = element;
  13. entry_height = jQuery(this).attr('clientHeight');
  14. }
  15. });
  16. jQuery('#content .post').css('height', entry_height);
  17. jQuery('#content .post:gt(0)').css('border-left', '1px solid #999');
  18. jQuery('#content .readmore a').each(function() {
  19. var item = jQuery(this);
  20. var width = (item.width() / 2) + 7;
  21. item.css('margin-left', -width);
  22. });
  23. }
  24. /* ]]> */
  25. </script>
  26. <div class="group">
  27. <?php if (have_posts()) : ?>
  28. <?php query_posts('showposts=3'); ?>
  29. <?php while (have_posts()) : the_post();
  30. if( $post->ID == $do_not_duplicate or $count > 2) continue; update_post_caches($posts); $count++; ?>
  31. <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
  32. <p class="postmetadata"><?php the_tags('', __(', ', 'depo-masthead'), '<br />'); ?></p>
  33. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'depo-masthead'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
  34. <small><?php printf(__('In %1$s on %2$s at %3$s', 'depo-masthead'), get_the_category_list(__(', ', 'depo-masthead')), '<strong>'.get_the_time(get_option('date_format')).'</strong>', '<strong>'.get_the_time().'</strong>'); ?></small>
  35. <div class="entry">
  36. <?php the_content(' '); ?>
  37. <?php edit_post_link(__('Edit this entry.', 'depo-masthead'), '<p>', '</p>'); ?>
  38. </div>
  39. <div class="readmore">
  40. <?php
  41. $moretag = strpos($post->post_content, '<!--more');
  42. $paged = strpos($post->post_content, '<!--nextpage');
  43. $next= '';
  44. if (!$moretag && !$paged)
  45. $full = true;
  46. else {
  47. $full = false;
  48. if (!$moretag)
  49. $next = '2/';
  50. else
  51. $next = '#more-'.$id;
  52. }
  53. if( $full == true && $post->comment_status == 'open' ) { ?>
  54. <a href="<?php the_permalink() ?>#comments" title="<?php printf(__('Comment on %s', 'depo-masthead'), the_title_attribute()); ?>"><?php _e('Comment&nbsp;&raquo;', 'depo-masthead'); ?> </a>
  55. <?php } elseif(!$full && $post->comment_status == 'open') { ?>
  56. <a href="<?php the_permalink(); echo $next; ?>" title="<?php printf(__('Comment and continue reading %s'), the_title_attribute()); ?>"><?php _e('Read&nbsp;More&nbsp;and&nbsp;Comment&nbsp;&raquo;', 'depo-masthead'); ?></a>
  57. <?php } elseif(!$full && $post->comment_status == 'closed') { ?>
  58. <a href="<?php the_permalink(); echo $next; ?>" title="<?php _e('Continue reading', 'depo-masthead'); the_title_attribute(); ?>"><?php _e('Read&nbsp;More&raquo;', 'depo-masthead'); ?></a>
  59. <?php } else { ?>
  60. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'depo-masthead'), the_title_attribute()); ?>"><?php _e('Permalink', 'depo-masthead'); ?> </a>
  61. <?php } ?>
  62. </div>
  63. </div>
  64. <?php endwhile; ?>
  65. <?php else : ?>
  66. <h2 class="center"><?php _e('Not Found', 'depo-masthead'); ?></h2>
  67. <p class="center"><?php _e('Sorry, but you are looking for something that isn\'t here.', 'depo-masthead'); ?></p>
  68. <?php include (TEMPLATEPATH . "/searchform.php"); ?>
  69. <?php endif; ?>
  70. </div>
  71. <?php get_sidebar(); ?>
  72. <?php get_footer(); ?>