0

I had to make the link of a div

<div onclick="location.href='<?php the_permalink() ?>';></div>

to make it work the way I needed it too. (Using Wordpress)

But I also need the link to open in a new window using target="_blank" but that I can't figure out how to apply that to an onclick in a div. Anyone any ideas?

user3735498
  • 11
  • 1
  • 6

1 Answers1

2

You could always make a the onclick open up a javascript function and do what ever you need in there.

Or if you want that format

<div onclick="window.open('<?php the_permalink() ?>')"></div>
pato.llaguno
  • 741
  • 4
  • 20