Forums

Navigation not working on index page (7 posts)

  1. adamsmark
    Member
    Posted 3 years ago #

    The navigation at the bottom of my site (http://agabus.com) does not work on the index page -- it does work on the search page. I think the problem rests with the them, for the navigation works on other themes. Here is the code for the theme in question; I'm using the "Journalist" theme featured at WordPress.

    <?php get_header(); ?>
    
    <?php
       if (is_home()) {
          query_posts("cat=-29");
       }
    ?>
    
    <div id="content" class="group">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    <p class="comments"><a href="<?php comments_link(); ?>"><?php comments_number('comments','with one comment','with % comments'); ?></a></p>
    
    <div class="main">
    	<?php the_content('Read the rest of this entry &raquo;'); ?>
    </div>
    
    <div class="meta group">
    <div class="signature">
        <p>Written by <?php the_author() ?> <span class="edit"><?php edit_post_link('Edit'); ?></span></p>
        <p><?php the_time('F jS, Y'); ?> <?php _e("at"); ?> <?php the_time('g:i a'); ?></p>
    </div>
    <div class="tags">
        <p><?php if(function_exists('wp_email')) { email_link(); } ?></p>
        <p><?php if(function_exists('wp_print')) { print_link(); } ?></p>
    </div>
    </div>
    
    <?php if ( comments_open() ) comments_template(); ?>
    
    <?php endwhile; else: ?>
    <div class="warning">
    	<p>Sorry, but you are looking for something that isn't here.</p>
    </div>
    <?php endif; ?>
    
    <div class="navigation">
    	<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    	<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    
    </div> 
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
  2. adamsmark
    Member
    Posted 3 years ago #

    I'm really struggling folks. Can't seem to get the navigation to work. It's definitely something in the theme, and I'm not inclined to change it. Any ideas?

  3. adamsmark
    Member
    Posted 3 years ago #

    --bump--

  4. Evita
    Member
    Posted 3 years ago #

    The simple reason is this code:

    <?php
       if (is_home()) {
          query_posts("cat=-29");
       }
    ?>

    WordPress navigation don“t love query posts, but there are some solutions for this problem. Search the forum for query_post + navigation.

  5. adamsmark
    Member
    Posted 3 years ago #

    The search is not yielding a solution.

    I want to exclude certain categories from the front page (index) but I also want the page navigation to work.

    I'm using this code, which I found at WordPress:

    <?php
       if (is_home()) {
          query_posts("cat=-29");
       }
    ?>

    How can I exclude certain categories and still get the navigation to work?

  6. adamsmark
    Member
    Posted 3 years ago #

  7. adamsmark
    Member
    Posted 3 years ago #

    Actually http://wordpress.org/extend/plugins/simply-exclude/ seems to work better, as it excludes a category from the front-page (index) weblog, but not in the sidebar, which is where they appear as asides.

Topic Closed

This topic has been closed to new replies.

About this Topic