How can I fill a DIV with a link?

I am having an issue with this php file:

<?php setup_postdata( $post ); ?>

<div <?php post_class("post") ?>>
  <?php if (is_sticky()): ?>
    <div class="featured-post wow flipInX" data-wow-delay="1s">
      <p>Featured</p>
    </div>
  <?php endif ?>
<h2><a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?></a></h2>
  <div class="three spacing"></div>
  <p style="display:hidden;" align="center"><a href="<?php echo get_permalink(); ?>" class="button boxed red tiny"> watch </a></p>
</div>

I need everything in the DIV to be linked, so if you click any part of it, it would take you to <?php echo get_permalink(); ?>

thoughts?

  • Luís

    Hi @seth11,

    I hope had been good today!

    Put your div inside an anchor element and removes all others of inside:

    <?php setup_postdata( $post ); ?>
    <a href="<?php echo get_permalink(); ?>">
    <div <?php post_class("post") ?>>
      <?php if (is_sticky()): ?>
        <div class="featured-post wow flipInX" data-wow-delay="1s">
          <p>Featured</p>
        </div>
      <?php endif ?>
    <h2><?php echo get_the_title(); ?></h2>
      <div class="three spacing"></div>
      <p style="display:hidden;" align="center">watch</p>
    </div>
    </a>

    I hope this information has been helpful. If I can help you in this or other questions, please let me know!

    Cheers, Luís

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.