• Hi,
    I’ve about 40 posts in my website, it’s 4 pages.
    But changing pages wont show others posts, it always shows last 10 posts, first i thought it’s because of using page-navi plugin, so i disabled it, but didn’t changed.
    permalinks is in default setting.
    What can cause the problem? How can i make it solved?
    Thanks in advanced.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Sounds like your theme’s index.php template is using a custom query that needs amending. Does the file include <?php query_posts(...);?>?

    Thread Starter msitman

    (@msitman)

    No it doesn’t have query, as far as i know related code is this:

    <?php
    $prev_link = get_previous_posts_link(__('???? &raquo;', 'kubrick'));
    $next_link = get_next_posts_link(__('&laquo; ????', 'kubrick'));
    ?>
    <?php if ($prev_link || $next_link): ?>
    <div class="art-Post">
        <div class="art-Post-tl"></div>
        <div class="art-Post-tr"></div>
        <div class="art-Post-bl"></div>
        <div class="art-Post-br"></div>
        <div class="art-Post-tc"></div>
        <div class="art-Post-bc"></div>
        <div class="art-Post-cl"></div>
        <div class="art-Post-cr"></div>
        <div class="art-Post-cc"></div>
        <div class="art-Post-body">
    <div class="art-Post-inner art-article">
    
    <div class="art-PostContent">
    
    <div class="navigation">
    	<?php wp_pagenavi(); ?>
    </div>

    nope, wrong place. That is your navigation, but it may not be related. The query if it exists would be at the beginning of your loop

    Thread Starter msitman

    (@msitman)

    After a lot of looking into codes finally i found out what’s the cause, it’s a plugin named “Vertical Scroll Recent Posts”
    And yes it has post_query inside:

    $sSql = query_posts('cat='.$vsrp_select_categories.'&orderby='.$vsrp_select_orderby.'&order='.$vsrp_select_order.'&showposts='.$num_user);

    and a coment out line right after that:

    //$vsrp_data = $wpdb->get_results("SELECT ID,post_title,post_date FROM ". $wpdb->prefix . "posts WHERE 1 and post_type='post' and post_status = 'publish' order by ID desc limit 0, $num_user");

    I’m using that plugin not as widget but at the very top of index.
    Anything wrong in it?

    Thread Starter msitman

    (@msitman)

    And these r definitions:

    $num_user = get_option('vsrp_select_num_user');
    	$dis_num_user = get_option('vsrp_dis_num_user');
    
    	$dis_num_height = get_option('vsrp_dis_num_height');
    	$vsrp_select_categories = get_option('vsrp_select_categories');
    	$vsrp_select_orderby = get_option('vsrp_select_orderby');
    	$vsrp_select_order = get_option('vsrp_select_order');
    
    	if(!is_numeric($num_user))
    	{
    		$num_user = 5;
    	}
    	if(!is_numeric($dis_num_height))
    	{
    		$dis_num_height = 30;
    	}
    	if(!is_numeric($dis_num_user))
    	{
    		$dis_num_user = 5;
    	}

    well, I don’t know the plugin. It should reset the query….but if not it doesn’t account for pagination in the query….
    https://www.rvoodoo.com/projects/wordpress/wordpress-tip-fixing-pagination-on-custom-queries-with-query_posts/

    Thread Starter msitman

    (@msitman)

    Thx man but i’m noob in coding, so i think i’ve to remove that plugin….. ??

    well…you can deactivate it and see if things work properly on your site. If so then we know its the plugin and can try to modify it

    Thread Starter msitman

    (@msitman)

    yes i did deactivate and page navigation worked right.
    would u plz take a look and it’s source?
    i’m making that website for and important person (2 me), and without that plugin home page is not so attractive!

    Ummmm..this is TOTALLY experimental… if it fails, worst thing that can happen is you’ll have to delete the plugin and reinstll with a fresh download of it (possibly by ftp or host file manager if we really break it). As always, I’ll recommend a database backup before doing any of this, although it shouldn’t affect anything in there. Replace:

    $sSql = query_posts('cat='.$vsrp_select_categories.'&orderby='.$vsrp_select_orderby.'&order='.$vsrp_select_order.'&showposts='.$num_user);

    With:

    $sSql = query_posts( array(
             // Set post type
    	'cat' => $vsrp_select_categories,
             'orderby' => $vsrp_select_orderby,
             'order' => $vsrp_select_order,
             'showposts' => $num_user,
    	// Enabled paging
    	'paged'=> ( get_query_var('paged') ? get_query_var('paged') : 1 ),
    	));

    If that don’t work, hen maybe it needs a reset query…. its hard for me to tell without seeing the plugin, and seeing it in context. But I hope it works, I’m gettin ready to head out

    Thread Starter msitman

    (@msitman)

    thx for the time dude but it didn’t work too.
    even this simple code causes page navigation not to work:

    <?php query_posts('showposts=8'); ?>
    		<ul>
    			<?php while (have_posts()) : the_post(); ?>
    			<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li><hr>
    			<?php endwhile;?>
    		</ul>

    If u like plugin’s page is:
    https://www.gopiplus.com/work/2010/07/18/vertical-scroll-recent-post/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Always showing last 10 posts !’ is closed to new replies.