Advertisement
Guest User

Original Blaskan index.php and loop.php

a guest
Feb 14th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. # # # # # # # # # INDEX.PHP
  2.  
  3. <?php get_header(); ?>
  4.  
  5. <section id="content" role="main">
  6. <?php get_template_part( 'loop', 'index' ); ?>
  7. </section>
  8. <!-- / #content -->
  9.  
  10. <?php get_sidebar(); ?>
  11.  
  12. <?php get_footer(); ?>
  13.  
  14. # # # # # # # # # LOOP.PHP
  15.  
  16.  
  17. <?php if ( ! have_posts() && ! is_front_page() ) : ?>
  18. <article id="post-0">
  19. <header>
  20. <h1><?php _e( 'Not Found', 'blaskan' ); ?></h1>
  21. </header>
  22.  
  23. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'blaskan' ); ?></p>
  24. <?php get_search_form(); ?>
  25. </article>
  26. <!-- /#post-0 -->
  27. <?php elseif ( ! have_posts() && is_front_page() ) : ?>
  28. <?php // We cant have #content empty. That would break sidebars. ?>
  29. &nbsp;
  30. <?php endif; ?>
  31.  
  32. <?php // Start the loop ?>
  33. <?php while ( have_posts() ) : the_post(); ?>
  34.  
  35. <?php if ( ( is_archive() || is_author() ) && ( !is_category() && !is_tag() ) ) : // Archives ?>
  36. <li>
  37. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'blaskan' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a>
  38. <time datetime="<?php the_date('c'); ?>"><?php print get_the_date(); ?></time>
  39. </li>
  40. <?php else: // Else ?>
  41.  
  42. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  43. <header>
  44. <?php if ( has_post_thumbnail() ) : ?>
  45. <figure class="post-thumbnail">
  46. <?php the_post_thumbnail(); ?>
  47. </figure>
  48. <?php endif; ?>
  49.  
  50. <?php if ( get_post_type() !== 'page' ): ?>
  51. <time datetime="<?php the_date('c'); ?>" pubdate><?php print get_the_date(); ?></time>
  52. <?php endif; ?>
  53.  
  54. <?php if ( !is_single() && get_the_title() ) : ?>
  55. <h1>
  56. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'blaskan' ), the_title_attribute( 'echo=0' ) ); ?>">
  57. <?php the_title(); ?>
  58. </a>
  59. </h1>
  60. <?php elseif ( get_the_title() ): ?>
  61. <h1><?php the_title(); ?></h1>
  62. <?php endif; ?>
  63. </header>
  64.  
  65. <div class="content">
  66. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'blaskan' ) ); ?>
  67. <?php wp_link_pages( array( 'before' => '<nav class="page-link" role="navigation">' . __( 'Pages:', 'blaskan' ), 'after' => '</nav>' ) ); ?>
  68.  
  69. <?php if ( !is_single() && !get_the_title() ) : ?>
  70. <p>
  71. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'blaskan' ), the_title_attribute( 'echo=0' ) ); ?>">
  72. <?php _e( 'Continue reading <span class="meta-nav">&rarr;</span>', 'blaskan' ); ?>
  73. </a>
  74. </p>
  75. <?php endif; ?>
  76. </div>
  77. <!-- / .content -->
  78.  
  79. <footer>
  80. <?php if ( get_post_type() !== 'page' ): ?>
  81. <span class="author"><span class="author-label"><?php _e( 'Written by', 'blaskan' ); ?></span> <?php the_author_posts_link(); ?></span>
  82. <?php endif; ?>
  83. <?php if ( !is_single() ): ?>
  84. <span class="comments"><?php comments_popup_link( __( 'No comments', 'blaskan' ), __( '<span>1</span> Comment', 'blaskan' ), __( '<span>%</span> Comments', 'blaskan' ) ); ?></span>
  85. <?php endif; ?>
  86. <?php if ( count( get_the_category() ) ) : ?>
  87. <span class="categories">
  88. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'blaskan' ), 'categories-label', get_the_category_list( ', ' ) ); ?>
  89. </span>
  90. <?php endif; ?>
  91. <?php
  92. $tags_list = get_the_tag_list( '', ', ' );
  93. if ( $tags_list ):
  94. ?>
  95. <span class="tags">
  96. <?php printf( __( '<span class="%1$s">Tagged with</span> %2$s', 'blaskan' ), 'tags-label', $tags_list ); ?>
  97. </span>
  98. <?php endif; ?>
  99.  
  100. <?php edit_post_link( __( 'Edit', 'blaskan' ), '<span class="edit">', '</span>' ); ?>
  101. </footer>
  102. </article>
  103. <!-- / #post-<?php the_ID(); ?> -->
  104.  
  105. <?php comments_template( '', true ); ?>
  106.  
  107. <?php if ( is_single() ): ?>
  108. <nav class="post-nav" role="navigation">
  109. <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '', 'Previous post link', 'blaskan' ) . '</span> %title' ); ?></div>
  110. <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '', 'Next post link', 'blaskan' ) . '</span>' ); ?></div>
  111. </nav>
  112. <!-- / .post-nav -->
  113. <?php endif; ?>
  114.  
  115. <?php endif; // End check which loop to display ?>
  116.  
  117. <?php endwhile; // End the loop. Whew. ?>
  118.  
  119. <?php /* Display navigation to next/previous pages when applicable */ ?>
  120. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  121. <nav class="post-nav" role="navigation">
  122. <div class="nav-previous"><?php next_posts_link( __( 'Older posts', 'blaskan' ) ); ?></div>
  123. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts', 'blaskan' ) ); ?></div>
  124. </nav>
  125. <!-- / .post-nav -->
  126. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement