Topic: Disable PageNavi ONLY on home page. How to?

Hello,

I want to disable the page navi only on homepage.
I'v found this topic, but it didn't work for me: http://www.arrastheme.com/forums/topic2 … enavi.html

I use WP-PageNavi plugin

Thank you.

Thumbs up

Re: Disable PageNavi ONLY on home page. How to?

Provide a link to your site please.

Re: Disable PageNavi ONLY on home page. How to?

my site (still in construction) http://www.lukotoolsservice.ro/
please log in
user: test
pass: 123456

Thumbs up

Re: Disable PageNavi ONLY on home page. How to?

Did you remove the lines as indicated in page linked for reference in your first post? It doesn't appear that you have.

It should be found in ...wp-content/themes/arras/home.php

Re: Disable PageNavi ONLY on home page. How to?

Because it had no efect, i'v change it back (home.php)

Now, i deleted again this lines from home.php:

<?php if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="navigation clearfix">
        <div class="floatleft"><?php next_posts_link( __('Older Entries', 'arras') ) ?></div>
        <div class="floatright"><?php previous_posts_link( __('Newer Entries', 'arras') ) ?></div>
    </div>
<?php } ?>


Still it doesn't work

P.S. I'v tried the both solutions from that post.

Thumbs up

Re: Disable PageNavi ONLY on home page. How to?

Are you using a static page as your homepage by chance?

Re: Disable PageNavi ONLY on home page. How to?

No, I am using the EFCA plugin and the node based new posts.

Thumbs up

Re: Disable PageNavi ONLY on home page. How to?

Please copy and paste the contents of your home.php file word for word here so that we can look at it.

Re: Disable PageNavi ONLY on home page. How to?

the home.php file:

<?php get_header(); ?>

<?php
$stickies = get_option('sticky_posts');
rsort($stickies);

$slideshow_cat    = arras_get_option('slideshow_cat');
$featured1_cat     = arras_get_option('featured1_cat');
$featured2_cat     = arras_get_option('featured2_cat');
$news_cat         = arras_get_option('news_cat');

$slideshow_count    = (int)arras_get_option('slideshow_count');
$featured1_count     = (int)arras_get_option('featured1_count');
$featured2_count     = (int)arras_get_option('featured2_count');

$post_blacklist = array();
?>

<div id="content" class="section">
<?php arras_above_content() ?>

<p><a href="http://www.lukotoolsservice.ro/?page_id=308"><img src="http://www.lukotoolsservice.ro/wp-content/uploads/2011/11/buttonnegociabil1.png" alt="" title="buttonnegociabil1" width="490" height="31" class="alignnone size-full wp-image-3324" /></a></p>

<?php if (!$paged) : ?>

<?php if ( $featured1_cat !== '' && arras_get_option('enable_featured1') ) : ?>
<?php arras_above_index_featured1_post() ?>
<!-- Featured Articles #1 -->
<div id="index-featured1">
<?php if ( arras_get_option('featured1_title') != '' ) : ?>
    <div class="home-title"><?php _e( arras_get_option('featured1_title'), 'arras' ) ?></div>
<?php endif;

arras_featured_loop( arras_get_option('featured1_display'), apply_filters('arras_featured1_query', array(
    'list'                 => $featured1_cat,
    'taxonomy'            => arras_get_option('featured1_tax'),
    'query'                => array(
        'posts_per_page'     => $featured1_count,
        'exclude'            => $post_blacklist,
        'post_type'            => arras_get_option('featured1_posttype')
    )
) ) );
?>
</div><!-- #index-featured1 -->
<?php endif ?>

<?php if ( $featured2_cat !== '' && arras_get_option('enable_featured2') ) : ?>
<?php arras_above_index_featured2_post() ?>
<!-- Featured Articles #2 -->
<div id="index-featured2">
<?php if ( arras_get_option('featured2_title') != '' ) : ?>
    <div class="home-title"><?php _e( arras_get_option('featured2_title'), 'arras' ) ?></div>
<?php endif;

arras_featured_loop( arras_get_option('featured2_display'), apply_filters('arras_featured2_query', array(
    'list'                 => $featured2_cat,
    'taxonomy'            => arras_get_option('featured2_tax'),
    'query'                => array(
        'posts_per_page'     => $featured2_count,
        'exclude'            => $post_blacklist,
        'post_type'            => arras_get_option('featured2_posttype')
    )
) ) );
?>

</div><!-- #index-featured2 -->
<?php endif; ?>

<?php if ( arras_get_option('enable_news') ) : ?>
<?php arras_above_index_news_post() ?>
<!-- News Articles -->
<div id="index-news">
<?php if ( arras_get_option('news_title') != '' ) : ?>
<div class="home-title"><?php _e( arras_get_option('news_title') ) ?></div>
<?php endif ?>
<?php
$news_query_args = apply_filters('arras_news_query', array(
    'list'                 => $news_cat,
    'taxonomy'            => arras_get_option('news_tax'),
    'query'                => array(
        'posts_per_page'     => arras_get_option('index_count'),
        'exclude'            => $post_blacklist,
        'post_type'            => arras_get_option('news_posttype'),
        'paged'                => $paged
    )
) );

$news_query = arras_prep_query($news_query_args);

query_posts($news_query);
arras_featured_loop( arras_get_option('news_display'), $news_query_args, true );

if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="navigation clearfix">
        <div class="floatleft"><?php next_posts_link( __('Older Entries', 'arras') ) ?></div>
        <div class="floatright"><?php previous_posts_link( __('Newer Entries', 'arras') ) ?></div>
    </div>
<?php } ?>

</div><!-- #index-news -->
<?php arras_below_index_news_post() ?>
<?php endif; ?>

<?php $sidebars = wp_get_sidebars_widgets(); ?>

<div id="bottom-content-1">
    <?php if ( isset($sidebars['sidebar-4']) ) : ?>
    <ul class="clearfix xoxo">
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Bottom Content #1') ) : ?>
        <li></li>
        <?php endif; ?>
    </ul>
    <?php endif; ?>
</div>

<div id="bottom-content-2">
    <?php if ( isset($sidebars['sidebar-5']) ) : ?>
    <ul class="clearfix xoxo">
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Bottom Content #2') ) : ?>
        <li></li>
        <?php endif; ?>
    </ul>
    <?php endif; ?>
</div>

<?php else: ?>

<?php if ( arras_get_option('news_title') != '' ) : ?>
<div class="home-title"><?php _e( arras_get_option('news_title') ) ?></div>
<?php endif ?>

<div id="archive-posts">
    <?php arras_render_posts(null, arras_get_option('archive_display')) ?>   


</div><!-- #archive-posts -->

<?php endif; ?>

<?php arras_below_content() ?>
</div><!-- #content -->
   
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Thank you.

Thumbs up

Re: Disable PageNavi ONLY on home page. How to?

You have not removed the following lines as asked to:

if(function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="navigation clearfix">
        <div class="floatleft"><?php next_posts_link( __('Older Entries', 'arras') ) ?></div>
        <div class="floatright"><?php previous_posts_link( __('Newer Entries', 'arras') ) ?></div>
    </div>
<?php } ?>

If these lines appear you will always see paged navigation.