On the edit page enter:
[jma_widget id=my-id]
get the id (which is “slug-like”) from the Widget Areas Page.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 |
function jma_widget($atts){ ob_start(); $x = ''; extract( shortcode_atts( array( 'id' => '', ), $atts ) ); echo themeblvd_widgets($id); $x = ob_get_contents(); ob_end_clean(); return str_replace("\r\n", '', $x); } add_shortcode('jma_widget','jma_widget'); |
Add to text edit screen.
0 1 2 3 4 5 6 7 8 9 10 11 |
function jma_quicktags() { if (wp_script_is('quicktags')){ ?> <script language="javascript" type="text/javascript"> QTags.addButton( 'JMA_widget', 'widget', '[jma_widget id=my_id]', '' ); </script> <?php } } add_action('admin_print_footer_scripts','jma_quicktags'); |