i can't manage to "see" the value of $originalArticle in echo '/'.$originalArticle.'== &'.$sameArticle; : i tried with "global" before, but it does not work... The output is for example :
/== &48
Any help?
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php $originalArticle = the_ID(); //this works ?>
<h2 class="entry-title">…</h2>
<div class="entry-utility">…</div><!-- .entry-utility -->
<?php
$cats = get_the_category();
$cat_obj = array_shift($cats);
$cat_id = (int) $cat_obj->cat_ID;
$second_query = new WP_Query( 'cat='.$cat_id.'&posts_per_page=2' );
while ( $second_query->have_posts() ) : $second_query->the_post();
$sameArticle = get_the_ID();
/* HERE */ echo '/'.$originalArticle.'== &'.$sameArticle; //output : /== &48
if ( $originalArticle == $sameArticle )
{
} else {
//...
Thanks for your help