Add pages to archive.php
-
On my WordPress site, https://day4ministries.com, categories, authors, etc. all come from archive.php.
These pages aren’t paginating (Displaying “More” or “Previous Posts”/”Newer Posts”) at the bottom.Example:
https://www.day4ministries.com/?page_id=64How do I add this functionality?
Here is archive.php
<?php get_header(); ?> <div id="sub-column"> <div id="sub-top"> <?php get_template_part('scripts/breadcrumb'); ?> </div> <div id="sub-content"> <div class="content"> <?php if (have_posts()) : echo"<h1 class='first'>"; ?> <?php if (is_day()) { ?> <?php the_time(get_option('date_format')); ?> <?php } elseif (is_month()) { ?> Archive for <?php the_time('F, Y'); ?> <?php } elseif (is_category()) { ?> <h1><?php echo single_cat_title(); ?></h1> <div class="catdesc"><?php echo category_description( $category ); ?></div> <?php } elseif (is_author()) { ?> <?php $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?> <h1><?php echo $curauth->nickname; ?></h1> <div class="alignleft"><?php userphoto($wp_query->get_queried_object()) ?></div> <?php echo $curauth->description; ?> <br /> <h1>Interact with <?php echo $curauth->first_name; ?>:</h1> <h2><dd><a href="<?php echo $curauth->user_url; ?>">Check out <?php echo $curauth->first_name; ?>'s Blog</a></dd></h2> <h2><dd><a href="<?php echo $curauth->twitter; ?>">Follow <?php echo $curauth->first_name; ?> on Twitter</a></dd></h2> <h2><dd><a href="<?php echo $curauth->facebook; ?>">Like <?php echo $curauth->first_name; ?> on Facebook</a></dd></h2> <h2><dd><a href="<?php echo $curauth->youtube; ?>">Watch <?php echo $curauth->first_name; ?> on YouTube</a></dd></h2> <h2><dd><a href="<?php echo $curauth->googleplus; ?>">Cicle <?php echo $curauth->first_name; ?> on Google+</a></dd></h2> <br /> <br /> <br /> <h1><b>Latest Posts:</b></h1> <?php } elseif (is_year()) { ?> Archive for <?php the_time('Y'); ?> <?php } elseif (is_search()) { ?> Search Results <?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> Blog Archives <?php } echo"</h1>"; while (have_posts()) : the_post(); $wpcx_thumb = wpcx_get_wp_generated_thumb("reference"); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h1><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a></h1> <div class="post_meta"> <span class="category"> <?php $wpcx_category = get_the_category(); $wpcx_name = $wpcx_category[0]->cat_name; $wpcx_id = $wpcx_category[0]->cat_ID; $wpcx_link = get_category_link($wpcx_id); echo "<a href='$wpcx_link' title='$wpcx_name'>$wpcx_name</a>"; ?> </span> <span class="date">Published <?php the_time(get_option('date_format')); ?> at <?php the_time(get_option('time_format'));?></span> <span class="comment_meta"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span> <br /> <span class="social"> <?php if(!empty($wpcx_cxOptions["social_fb_like"])) { if($wpcx_cxOptions["social_fb_like"] == "yes") { ?> <iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=75&action=like&font&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe> <?php } } ?> <a href="https://twitter.com/share" class="twitter-share-button" data-via="Day4Ministries">Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> <?php if(!empty($wpcx_cxOptions["social_google_like"])) { if($wpcx_cxOptions["social_google_like"] == "yes") { ?> <span class="google"><g:plusone size="medium"></g:plusone></span> <?php } } ?> </span> </div> <?php if(!empty($wpcx_thumb)) { ?> <div class="with_image"> <img src="<?php echo $wpcx_thumb;?>" /> <?php } else { echo "<div class='no_image'>"; } ?> <?php the_excerpt();?> </div> </div> <?php endwhile; else: ?> <div class="post"> <h1>Nothing found</h1> <p>Sorry, no posts matched your criteria.</p> </div> <?php endif; ?> <?php get_template_part('scripts/wp-pagenavi'); if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { wp_link_pages(); } ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
- The topic ‘Add pages to archive.php’ is closed to new replies.