Hi,
I'm looking for some help:
I need, when the user click on 'read more', to save the post id in a javascript var.
If i use:
<div id="post-<?php the_ID(); ?>">
<script type='text/javascript'>
<?php
$num_post="post-".get_the_ID();
echo "var selected_post='$num_post";
?>
</script>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]
the code write the right var for every post, but if I try to use it, I always have the id of the last post of the page. How can I save only the necessary var?