Forums

[resolved] Pages not working, shows me the home page (7 posts)

  1. MrSerginho
    Member
    Posted 1 year ago #

    Hi there,

    I'm trying to solve this problem for like a month. If you visit emisto.net and go to the bottom of the home page and click on pagenavi page 2, you will see that the link works, but it shows me the posts from first page (home page).

    Please somebody help me. Thanks.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    It sounds like your theme's index.php template file uses a custom query that needs amending.

  3. MrSerginho
    Member
    Posted 1 year ago #

    So what should i do? I have index.php and also home.php
    Thanks.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Look in home.php for a query_posts custom query.

  5. MrSerginho
    Member
    Posted 1 year ago #

    Found this:

    <div id="body">     <!-- Body [sidebar, posts] -->           
    
                <div id="content">     <!-- Contents -->
    
                <?php
    	    $post = $wp_query->post;
    	   	 $id = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE slug='" .get_option('gallery-category') ."'");
    
    	   	   ?>
    
             <?php if (have_posts()) : ?>
    <?php query_posts('cat=-' .$id .''); ?>
    
                    <?php while (have_posts()) : the_post(); ?>
  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try changing:

    <?php query_posts('cat=-' .$id .''); ?>

    to:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=-' .$id .'&paged=' . $paged); ?>
  7. MrSerginho
    Member
    Posted 1 year ago #

    It works, thanks mate.

Topic Closed

This topic has been closed to new replies.

About this Topic