Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. single.php:
  2.  
  3. <?php
  4. /**
  5. * The Template for displaying all single posts.
  6. *
  7. * @package WordPress
  8. * @subpackage Pronto
  9. * @since Pronto 1.0
  10. */
  11.  
  12. get_header(); ?>
  13.  
  14. <?php while ( have_posts() ) : the_post(); ?>
  15.  
  16. <?php if ( !post_password_required() ) { ?>
  17. <?php get_template_part('content', get_post_format() ); ?>
  18. <?php } ?>
  19. <div id="primary" class="content-area clr">
  20. <div id="content" class="site-content boxed" role="main">
  21. <!-- <header class="post-header">
  22. <h1 class="post-header-title"><?php the_title(); ?></h1>
  23. <!-- <ul class="meta single-meta clr">
  24. <?php if ( get_theme_mod('wpex_post_date','1') == '1' ) { ?>
  25. <li><i class="fa fa-clock-o"></i><?php the_date(); ?></li>
  26. <?php } ?>
  27. <?php if ( get_theme_mod('wpex_post_category','1') == '1' ) { ?>
  28. <li><i class="fa fa-folder-open"></i><?php the_category(' / '); ?></li>
  29. <?php } ?>
  30. <!-- <?php if( comments_open() ) { ?>
  31. <li class="comment-scroll"><i class="fa fa-comment"></i> <?php comments_popup_link(__('Leave a comment', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link', __('Comments closed', 'wpex')); ?></li>
  32. <?php } ?>
  33. <?php if ( get_theme_mod('wpex_post_author','1') == '1' ) { ?>
  34. <li><i class="fa fa-user"></i><?php the_author_posts_link(); ?></li>
  35. <?php } ?> ->
  36. </ul><!-- .meta -->
  37. </header><!-- .post-header -->
  38. <article class="entry clr">
  39. <?php the_content(); ?>
  40. </article><!-- /entry -->
  41. <?php wp_link_pages( array( 'before' => '<div class="page-links clr">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
  42. <?php if ( get_theme_mod('wpex_blog_tags', '1' ) =='1' ) : ?>
  43. <?php the_tags('<div class="post-tags clr">','','</div>'); ?>
  44. <?php endif; ?>
  45. <!-- <?php comments_template(); ?>
  46. </div><!-- #content -->
  47. <nav class="single-nav clr">
  48. <?php next_post_link('<div class="single-nav-left col span_12 clr-margin">%link</div>', '&larr; %title', false); ?>
  49. <?php previous_post_link('<div class="single-nav-right col span_12">%link</div>', '%title &rarr;', false); ?>
  50. </nav><!-- .page-header-title -->
  51. </div><!-- #primary -->
  52. <?php endwhile; ?>
  53. <?php get_footer(); ?>
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. functions/pagination.php:
  62.  
  63. <?php
  64. /**
  65. * Custom pagination functions
  66. *
  67. * @package WordPress
  68. * @subpackage Pronto
  69. * @since Pronto 1.0
  70. */
  71.  
  72.  
  73. // Numbered pagination
  74. if ( ! function_exists('wpex_pagination') ) {
  75.  
  76. function wpex_pagination() {
  77. global $wp_query;
  78. $total = $wp_query->max_num_pages;
  79. $big = 999999999; // need an unlikely integer
  80. if( $total > 1 ) {
  81. if( !$current_page = get_query_var('paged') )
  82. $current_page = 1;
  83. if( get_option('permalink_structure') ) {
  84. $format = 'page/%#%/';
  85. } else {
  86. $format = '&paged=%#%';
  87. }
  88. echo paginate_links(array(
  89. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  90. 'format' => $format,
  91. 'current' => max( 1, get_query_var('paged') ),
  92. 'total' => $total,
  93. 'mid_size' => 4,
  94. 'type' => 'list',
  95. 'prev_text' => '<i class="fa fa-angle-left"></i>',
  96. 'next_text' => '<i class="fa fa-angle-right"></i>',
  97. ));
  98. }
  99. }
  100.  
  101. }
  102.  
  103.  
  104. // Custom page entry pagination function
  105. if ( !function_exists('wpex_pagejump') ) {
  106.  
  107. function wpex_pagejump($pages = '', $range = 4) {
  108.  
  109. $showitems = ($range * 2)+1;
  110. global $paged;
  111. if ( empty($paged) ) $paged = 1;
  112.  
  113. if ( $pages == '' ) {
  114. global $wp_query;
  115. $pages = $wp_query->max_num_pages;
  116. if(!$pages) {
  117. $pages = 1;
  118. }
  119. }
  120.  
  121. if ( 1 != $pages ) {
  122. echo '<div class="post-navigation clr"><div class="alignleft">';
  123. previous_posts_link( '&larr; ' . __('Newer Posts', 'wpex' ) );
  124. echo '</div><div class="alignright">';
  125. next_posts_link( __('Older Posts', 'wpex' ) .' &rarr;' );
  126. echo '</div></div>';
  127. }
  128.  
  129. }
  130.  
  131. }
  132.  
  133.  
  134. // Infinite Scroll
  135. if ( !function_exists( 'wpex_infinite_scroll' ) ) {
  136.  
  137. function wpex_infinite_scroll( $type = 'standard' ) {
  138.  
  139. // Output pagination HTML
  140. $output = '';
  141. $output .= '<div class="infinite-scroll-nav clr">';
  142. $output .= '<div class="alignleft newer-posts">';
  143. $output .= get_previous_posts_link('&larr; '. __( 'Newer Posts', 'wpex' ) );
  144. $output .= '</div>';
  145. $output .= '<div class="alignright older-posts">';
  146. $output .= get_next_posts_link( __( 'Older Posts', 'wpex' ) .' &rarr;');
  147. $output .= '</div>';
  148. $output .= '</div>';
  149. echo $output;
  150. }
  151.  
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement