themes - Wordpress index.php: Show div just when site contains 6 posts -


in wordpress index.php need know if page has enough posts (more 6) pagination active or not , when pagination active want show div element.

you can count number of posts in query using $post_count. example:

<?php      // query     $the_query = new wp_query( $args );      $post_count = $the_query->post_count;      if ( $post_count > 6 ) {         // show div here...     } ?> 

read more in codex.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -