I'm a little stuck with a piece of PHP I am working on, I need to set the href of a link to the same ID for the DIV below it, but its not setting them the same.
$x=1;
while ( $loop->have_posts() ) : $loop->the_post();
if($color!='')
{
$out.='<'.$heading.' class="heading_accordion newHeadingColor">'.get_the_title().'</'.$heading.'>';
}
else
{
$out.='<dd class="accordion-navigation"><a href="#panel'.$x++.'">'.get_the_title().'</a>';
}
$out.= '<div id="panel'.$x++.'" class="content">'.get_the_content().'</div></dd>';
endwhile; // end of the loop.
its doing
<a href="#panel1">link</a>
<div id="panel2">content</div>
<a href="#panel3">link</a>
<div id="panel4">content</div>
<a href="#panel5">link</a>
<div id="panel6">content</div>
and need something like
<a href="#panel1">link</a>
<div id="panel1">content</div>
<a href="#panel2">link</a>
<div id="panel2">content</div>
<a href="#panel3">link</a>
<div id="panel3">content</div>
the_ID();?