I’ve tried to follow the example for Testing for paginated Pages but i don’t know why it isn’t working. i put it in the single.php file for post detection. i don’t know why the page_test is broken. example code here:
<?php
get_header();
?>
<div id="content" class="narrowcolumn" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div style="margin-top:5px">
<div style="padding:5px; float:left; margin-right:50px;"><fb:share-button href="<?php the_permalink(); ?>" class="url" type="button_count"></fb:share-button></div>
<?php
$page_test = $wp_query->get( 'paged' );
if ( ! $page_test || $page_test < 2 ) {
something here...
<?php } else { ?>
another here...
<?php } ?>
You need to either add
global $wp_query;
or use
get_query_var();
the above solution i tried already.
Never mind, i solved it, even i don’t know why. if some body knows…:
this:
didn’t worked, but this:
did work. the difference is “page” instead of “paged”. i don’t know why everywhere i looked i’ve found the code with “paged” and it didn’t worked (even it the conditional tags page in the codex!), but here, in a simple topic i found it.
nevertheless, it is solved.