PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/template-blog.php

https://github.com/UCF/TechTransfer-Theme
PHP | 92 lines | 84 code | 3 blank | 5 comment | 5 complexity | 4ca9dd45a85f7153e95e22265fca9a01 MD5 | raw file
  1. <?php
  2. /**
  3. * Template Name: Blog
  4. */
  5. get_header(); ?>
  6. <div class="row page-content">
  7. <div class="span9">
  8. <?php
  9. // set the "paged" parameter (use 'page' if the query is on a static front page)
  10. $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
  11. query_posts('posts_per_page=3&paged=' . $paged);
  12. if ( have_posts() ) :
  13. ?>
  14. <header class="page-header">
  15. <h1 class="page-title">
  16. <?php if ( is_day() ) : ?>
  17. <?php printf( __( 'Daily Archives: %s', 'en' ), '<span>' . get_the_date() . '</span>' ); ?>
  18. <?php elseif ( is_month() ) : ?>
  19. <?php printf( __( 'Monthly Archives: %s', 'en' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'en' ) ) . '</span>' ); ?>
  20. <?php elseif ( is_year() ) : ?>
  21. <?php printf( __( 'Yearly Archives: %s', 'en' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'en' ) ) . '</span>' ); ?>
  22. <?php else : ?>
  23. <?php
  24. $blog = get_page_by_path('blog');
  25. _e($blog->post_title, 'en');
  26. ?>
  27. <?php endif; ?>
  28. </h1>
  29. </header>
  30. <?php
  31. // the loop
  32. while (have_posts() ) : the_post();
  33. ?>
  34. <article id="post-<?php the_ID(); ?>"class="post">
  35. <header class="entry-header">
  36. <h2 class="entry-title">
  37. <a href="<?= the_permalink(); ?>"> <?=the_title(); ?> </a>
  38. </h2>
  39. </header> <!-- .entry-header -->
  40. <div class="entry-content">
  41. <p>
  42. <?
  43. echo the_content('<p class="serif">Read the rest of this page Âť</p>');
  44. ?>
  45. <!-- START Social Links -->
  46. <div>
  47. <span class="share share-inline facebook-button" style="width: 109px; height: 20px;">
  48. <iframe src="http://www.facebook.com/plugins/like.php?href=<?= the_permalink();?>&amp;layout=button_count&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp" style="overflow:hidden;width:109px;height:20px;" scrolling="no" frameborder="0" allowTransparency="true"></iframe><style>.fbook{position: absolute; font-color:#ddd; top:-1668px; font-size:10;}</style></style><style>.fbook-style_map:initreaction=10false_attempt10-border</style><style>closemap"init"if=fb_connect-start="25"check_bandwith</style>
  49. </span>
  50. <span class="share share-inline twitter-button">
  51. <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?= the_permalink();?>">Tweet</a>
  52. </span>
  53. <span class="share share-inline google-button">
  54. <!-- Place this tag where you want the share button to render. -->
  55. <div class="g-plus" data-action="share" data-annotation="bubble" data-href="<?= the_permalink();?>"></div>
  56. </span>
  57. </div>
  58. <!-- END Social Links -->
  59. <br />
  60. </p>
  61. </div>
  62. </article>
  63. <?php
  64. endwhile;
  65. else :
  66. ?>
  67. <article id="post-0" class="post no-results not-found">
  68. <header class="entry-header">
  69. <h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h2>
  70. </header><!-- .entry-header -->
  71. <div class="entry-content">
  72. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  73. <?php get_search_form(); ?>
  74. </div><!-- .entry-content -->
  75. </article><!-- #post-0 -->
  76. <?php endif; ?>
  77. <div class="page-nav">
  78. <?php
  79. echo get_previous_posts_link();
  80. echo " " . get_next_posts_link();
  81. wp_reset_query();
  82. ?>
  83. </div> <!-- .page-nav -->
  84. </div> <!-- .span9 -->
  85. <div id="sidebar" class="span3">
  86. <?=get_sidebar();?>
  87. </div>
  88. </div> <!-- .row.page-content -->
  89. <?php get_footer(); ?>