How to create your own WordPress shortcode
Added below code to your function.php file of your active child theme (or theme). add_shortcode(‘display_shortcode’,’my_shortcode’); function my_shortcode() { echo “hello world”; // write here your html code what ever you display } Added below code in your php file where…
How to use Widget as Shortcode in WordPress Page, Post
function widget($atts) { global $wp_widget_factory; extract(shortcode_atts(array( ‘widget_name’ => FALSE, ‘instance’ => ” ), $atts)); $widget_name = esc_html($widget_name); if (!is_a($wp_widget_factory->widgets[$widget_name], ‘WP_Widget’)): $wp_class = ‘WP_Widget_’.ucwords(strtolower($class)); if (!is_a($wp_widget_factory->widgets[$wp_class], ‘WP_Widget’)): return ”.sprintf(__(“%s: Widget class not found. Make sure this widget exists and the class…