Custom Shortcode and Enable Shortcodes for Widgets (Wordpress)

//Add shortcodes function cart_function( $atts ){ ?> <!-- shortcode content here --> <?php } add_shortcode( 'cart_icon', 'cart_function' ); //Enables shortcodes for widgets add_filter('widget_text', 'do_shortcode'); ?> <!-- display in pages, posts, widgets, etc. with [cart_icon] -->

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.