WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess and 404 pages (7 posts)

  1. scofield888
    Member
    Posted 4 years ago #

    Hi,

    I'm currently working on a site and I've been having problems with my pages navigation. I'm currently using the "WP-Pagenavi" plugin.

    Homepage: http://www.thecreditcardguide.com.au/

    Category: http://www.thecreditcardguide.com.au/low-balance-transfer

    On the homepage, when you click on "2" to go to the next page, it works just fine.

    But on the category, when you click on "2", it redirects me to a 404 page.

    I have tried several fixes but none of them worked for me.

    http://www.recommendedwebtools.com/index.php/69/htaccess-and-wordpress/

    http://codex.wordpress.org/Using_Permalinks

    http://wordpress.org/support/topic/51613?replies=16#post-283222

    http://wordpress.org/support/topic/241418?replies=7

    I really have no idea why it's suddenly now working anymore. Is it a problem with WP-Pagenavi, .htaccess or another plugin?

    Hoping for some great solution to this problem. Thanks a lot in advance!

  2. Lester Chan
    Member
    Posted 4 years ago #

    Does it happen on the default theme? If it does not happen on the default theme, means there is a problem with query_post() in your category.php or archive.php.

    You may want to read http://codex.wordpress.org/Template_Tags/query_posts you need to pass in $query_string variable to the query_post()

  3. scofield888
    Member
    Posted 4 years ago #

    Yes. I tried using the default theme and this problem also happens. The current permalink structure is: /%category%/%postname%/.

    Do you think that this might have something to do with this?

    As for the problem with query_post(), unfortunately, I'm just a newbie in PHP and really can't find a way to make this work. :(

    I'm using the archive.php file and here is the code (hopefully it helps).

    <?php get_header(); ?>

    <?php if (have_posts()) : ?>
    <div class="box post">
    <div class="content">
    <div class="post-title">
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1><!--Category:--> <span><?php single_cat_title(); ?></span></h1><?php if(category_description()) { echo '<span class="description" style="font-size: 13px;">'.category_description().'</span>'; } ?>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h1><!--Tag:--> <span><?php single_tag_title(); ?></span></h1>
    <?php if(tag_description()) { echo '<span class="description" style="font-size: 13px;">'.tag_description().'</span>'; } ?>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h1>Archive: <span><?php the_time('F jS, Y'); ?></span></h1>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h1>Archive: <span><?php the_time('F, Y'); ?></span></h1>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h1>Archive: <span><?php the_time('Y'); ?></span></h1>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h1>Author Archive</h1>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h1>Blog Archives</h1><?php } ?>
    </div>
    <!--<div class="tag-description">
    <?php echo tag_description(); ?>
    </div>-->
    </div>
    </div>

    <?php while (have_posts()) : the_post(); ?>

    <div class="box post" id="post-<?php the_ID(); ?>">
    <div class="content">
    <div class="rank"><img src="<?php echo get_post_meta($post->ID, 'posts-rank', true); ?>" /></div>
    <?php $postimageurl = get_post_meta($post->ID, 'post-img', true); if ($postimageurl) { ?>
    <div class="pic fl">
    " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><img src="<?php echo $postimageurl; ?>" alt="Post Pic" width="200" height="200" />
    </div>
    <?php } ?>
    <div class="post-title">
    <h2>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
    </div>
    <!--/post-title -->
    <div class="post-date"><!--On <?php the_time('m.d.y') ?>,--> Category: <?php the_category(', ') ?><!--, by <?php the_author_posts_link(); ?>--></div>
    <div class="post-excerpt"><?php the_excerpt(); ?></div>
    <!--/post-excerpt -->
    </div>
    <!--/content -->
    <div class="hl"></div>
    <div class="social-links">
    <div class="fl">
    <span><?php comments_number(0, 1, '%'); ?></span>
    #comments" title="View Comments">Comments
    </div>
    <div class="fr"><span>#respond" title="Post Title - Read more..."><?php the_title(); ?> - Read more...</span></div>
    <br class="fix" />
    </div>
    <!--/social-links -->
    </div>
    <!--/box -->

    <?php endwhile; ?>

    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

    <?php /*

    • <?php next_posts_link('« Older Entries') ?>
    • <?php previous_posts_link('Newer Entries »') ?>

    */ ?>

    <?php else : ?>

    <div class="box post">
    <div class="content">
    <div class="post-title">
    <h1>No Posts Were Found</h1>
    </div>
    </div>
    </div>

    <p style="padding-left: 20px;"> </p>

    <?php endif; ?>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    If you guys think that my questions are a bit out of place, please don't hesitate to let me know.

    Thanks again! ;)

  4. scofield888
    Member
    Posted 4 years ago #

    bump

  5. scofield888
    Member
    Posted 4 years ago #

    can anyone please help? :)

  6. hydn
    Member
    Posted 3 years ago #

    wow. Looking at this I wonder if I will every get help for my thread. Did you ever figure this out?

  7. SEObomj
    Member
    Posted 3 years ago #

    the analog rubbish

Topic Closed

This topic has been closed to new replies.

About this Topic