Support » Plugin: Block Lab » Is it possible to wrap content with an ‘a’ tag

  • Resolved bluestcube

    (@bluestcube)


    First, Thank you for a great plugin. Is it possible to create a block that wraps all the content in link tag. This is what I have so far.

    `<div class=”article-module”>
    <!– <a href=””> Added using a URL selector –>
    <div>
    <h3>
    <span><?php block_field( ‘heading’ ); ?></span>
    </h3>
    </div>
    <img src=”<?php block_field( ‘article-thumbnail’ ); ?>” alt=”<?php block_field( ‘heading’ ); ?>” />
    <!– </a> –>
    </div>`

    • This topic was modified 2 months, 2 weeks ago by bluestcube.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Luke Carbis

    (@lukecarbis)

    @bluestcube Yes, this _should_ work, except that it’s not good practice to wrap a <div> in an <a> (since an anchor is inline, and a div is a block). You would just need to output the url in the href, for example:

    <a href="<?php block_field( 'url' ); ?>">

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @bluestcube,
    Thanks for your great compliment!

    Is it possible to create a block that wraps all the content in link tag.

    Yes! That markup that you shared above looks good.

    It should work fine 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.