PHP make the whole container as link (not only the button)

im a total php illiterate so i wanted to make a change in the php file of my wordpress website. i have some cards which represent my services but the clickable link is only in the “read more…” phrase but i want to make the whole card be as a link.
below is the php code i think is associated with that:

<?php elseif( $style == 'style_5' ) : ?>
                <h3><?php echo esc_html( $title ); ?></h3>
            <?php else : ?>
                <h4 class="no_stripe"><?php echo esc_html( $title ); ?></h4>
            <?php endif; ?>
        </div>
    <?php } ?>
    <?php echo wpb_js_remove_wpautop( $content, true ); ?>
    <?php
    if ( $link['url'] ) {
        if ( ! $link['title'] ) {
            $link['title'] = esc_html__( 'Read More', 'consulting' );
        }
        if ( ! $link['target'] ) {
            $link['target'] = '_self';
        }
        if( $icon ){
            $link['title'] = '<span>' . esc_html( $link['title'] ) . '</span>' . '<i class=" ' . esc_attr( $icon ) . ' stm_icon"></i>';
        }
        echo ' <a class="read_more" target="' . esc_attr( $link['target'] ) . '" href="' . esc_url( $link['url'] ) . '">' . $link['title'] . '</a>';
    }
    ?>
    <?php if( $style == 'style_3' ): ?>
        </div>
    <?php endif; ?>

<?php endif; ?>

any help would be highly appreciated!

thanks!

Read more here: PHP make the whole container as link (not only the button)

Leave a Reply

Your email address will not be published. Required fields are marked *