Click to See Complete Forum and Search --> : One PHP function breaking innerHTML - Need Help


CarlMartin10
September 20th, 2010, 09:14 PM
I have tested this innerHTML deal with some php calls, and it works fine....except for on the one I need it to work on. I have to get this to work. This is one of the very last issues on the site and I need to launch immediately! Thanks!

I am trying to recreate the functionality on this page in WordPress: http://iwearyourshirt.com/testimonials (click on the customers to see the content at the top of the page change)

I am close, and it works with this code:

<?php $my_query = new WP_Query('cat=7');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?>
<div class="reviews-date">
<?php the_date(); ?>
</div>
<a href="#self" onclick="document.getElementById('expansion').innerHTML = '<?php the_title() ?>';">This is an example</a>
</div>
<?php endwhile; ?>

But when I try to add <?php the_content() ?> right after <?php the_title() ?> in the innerHTML portion the entire content is displayed, no links like they are supposed to be.

The working example is up right now. I can put in the non-working example if you need me to. Thanks.

The site: http://billboardfamily.com/our-reviews/

PeejAvery
September 21st, 2010, 12:53 PM
Its probably a quote mark issue. Have you checked what quotes are being outputted?

CarlMartin10
September 21st, 2010, 02:32 PM
I agree, that seems to be the issue....but, it is wordpress, so I do not know where in all those wordpress files the extra quote is being generated.... :(

PeejAvery
September 21st, 2010, 03:09 PM
Do a "contains" search to find the files containing those functions.

CarlMartin10
September 21st, 2010, 03:14 PM
crazy....it did not find anything

PeejAvery
September 22nd, 2010, 07:54 AM
Make sure you're not looking for the closing parenthesis. PHP can have predefined parameters.