How to assign value to a variable in the loop?

katysouciercdh

New Member
I have a Wordpress loop:\[code\]while ( $query->have_posts() ) : $query->the_post(); echo'<h3><a href="http://stackoverflow.com/questions/8720077/index.php?page_id=100">';the_title(); echo'</a></h3>'; echo'<h4>'.the_excerpt().'</h4>\[/code\]How can I assign post id value to a variable in this loop?\[code\]$id = the_id();\[/code\] don't work.
 
Back
Top