Add “View Details” button to shortcode output

12 seconds

The following code will add a View Details button to the bottom of each item displayed via the shortcodes, similar to how the WooConnect add-on adds view details and buy now buttons.

* WP Dispensary – view details button
add_action( 'wpd_shortcode_inside_bottom', 'acme_viewdetails' );
function acme_viewdetails() { ?>
<p><a href="<?php the_permalink(); ?>" class="acme-button">View Details</a></p>
<?php } // function acme_viewdetails

Was this article helpful?

Leave a Reply

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