WordPress.org

Ready to get started?Download WordPress

Forums

Problem trying to have "Older posts link" on archive.php custom template (3 posts)

  1. kkoci
    Member
    Posted 1 year ago #

    Hi, i'm new to the forum, i'm just stuck trying to "getpagenavi" declared on functions.php to work.

    I specifically need it on the archive.php, this is my code:

    <?php get_header(); ?>
    
    <div>&nbsp;</div>
    <div>&nbsp;</div>
    <div class="subhead">
    	<div class="insubhead">
    		<?php if (have_posts()) : ?>
    
    		 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h1 class="pagetitle">Archivo de <?php the_time('F jS, Y'); ?></h1>
    
    	 <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    		<h1 class="pagetitle">Archivo de <?php the_time('F, Y'); ?></h1>
    
    		<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    		<h1 class="pagetitle">Archivo de <?php the_time('Y'); ?></h1>
    
    	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    		<h1 class="pagetitle">Archivo por Autor</h1>
    
    		<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    		<h1 class="pagetitle">Archivos del Blog</h1>
    		<?php } ?>
    	</div>
    
    </div>
    <div class="right">
    
    <div class="featbox"><h3 class="sidetitl"></h3><pre>
    <?php // code goes here
    
    ?>
    </pre>
     <?php $video = get_option('repo_video'); echo stripslashes($video); ?></div> </div>
    <div id="content" >
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="postarch" id="post-<?php the_ID(); ?>">
    <div class="title">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    
    <div class="postmeta" width=755px; height=55px;>
    	 <span class="clock">  <?php the_time('M - j - Y'); ?></span> <span class="comm"><?php comments_popup_link('0 Comentarios', '1 Comentario', '% Comentarios'); ?></span> <span class="category">Categorias: <?php the_category(', '); ?> </span>
    </div>
    <div class="entry">
    
    <?php
    if ( has_post_thumbnail() ) { ?>
    	<img class="postimg" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&h=120&w=160&zc=1" alt="" />
    <?php } else { ?>
    	<img class="postimg" src="<?php bloginfo('template_directory'); ?>/images/dummy.png" alt="" />
    <?php } ?>
    
    <?php wpe_excerpt('wpe_excerptlength_blurb', ''); ?>
    <div class="clear"></div>
    </div>
    
    </div>
    
    <?php endwhile; ?>
    
    <?php getpagenavi();?>
    <?php else : ?>
    
    	<h1 class="title">Inexistente</h1>
    	<p>Disculpe, la categoria que busca no se encuentra aqui.</p>
    
    <?php endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I just don't know to make it work, if someone has some code or plugin answer? Would be awesome, thanks in advance!

  2. bcworkz
    Member
    Posted 1 year ago #

    I don't really see anything wrong with your template, I'm guessing either the query is not indicating there's more pages or there's a glitch in the function.

  3. kkoci
    Member
    Posted 1 year ago #

    Hi, thank you very much, I already solved the issue, i just forgot to tell wordpress in the settings section (Reading option) to show a specific number of articles in pages, thanks a lot anyways, cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic