Add Shortcode
Creates a custom shortcode. In this example, this is the shortcode: [custom]
PHP
function custom_shortcode($atts, $content = null) {
return '<div class="custom-shortcode">' . $content . '</div>';
}
add_shortcode('custom', 'custom_shortcode');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY