jonnyplow
Member
Posted 1 year ago #
I use wp_pagenavi and have it wrapped in other styling. I'm basically trying to figure out how not to show that other styling that's included inside my if function_exists statement if wp_pagenavi, or whatever function, is not being USED at that time, even if it does exists. Because if I have a category page that has less posts than the page break amount, it still shows the styling stuff minus the wp_pagenavi.
<?php if(function_exists('wp_pagenavi')) { ?>
<div class="somestyledclass">
<?php wp_pagenavi(); ?>
</div>
<?php } ?>
Any ideas?
I use it like this and it works perfectly..... I'm not seeing any issue with yours tho.....
<?php if(function_exists('wp_pagenavi')) : ?>
<div class="pnavi">
<?php wp_pagenavi(); ?>
</div>
<?php else : ?>
<div class="alignleft"><?php next_posts_link(__('« Older Entries')); ?></div>
<div class="alignright"><?php previous_posts_link(__('Newer Entries »')); ?></div>
<?php endif; ?>
jonnyplow
Member
Posted 1 year ago #
Thank Rev, I see what you're saying. But I'm trying to make <div class="somestyledclass"> simply not show when wp_pagenavi doesn't appear on the page, even when the function still exists.
Ah, I see what you are saying now...
http://codex.wordpress.org/Conditional_Tags#A_Paged_Page
!is_paged() possibly?