I’d like to create a link that opens the selected post via javascript onclick in the loop.
If I use <a href="<?php the_permalink(); ?>More...</a>
in the loop it opens the correct post.
But If I use
<script>
function open_win()
{
window.open("<?php the_permalink(); ?>")
}
</script>
<a href="#" onclick="open_win()">More...</a>
it just won’t open the correct selected post. How can I make this work?
You could use the following:
It seems like a bit more work than it’s worth though, the following would have the same result of the link opening in a new window: