I have a standart loop with:
<article class="somepost">
<?php $a = get_the_title(); echo $a; ?>
</article>
How I get value of some post’s title, when I click on some article (class=”somepost”)
$('.somempost').click(function(){ ??? });
Thanx.
First, I would set the title to the articles data attribute:
Then in your jQuery, set the title to a variable like so: