Extra paragraph tags in an enclosing shortcode

OK, it seems someone has trod this path and there is in fact…. shortcode_unautop() Job Done. It looks elegant in the editor and works in the output. The shortcode now looks like this; function column_shortcode($atts = [], $content = null) { $content=”<div class=”two-column”>”.$content.'</div>’; $content = shortcode_unautop($content); return $content; } add_shortcode(‘two-column’, ‘column_shortcode’);

Custom shortcode is not working in text widget

Shortcodes need to return data, not echo it – use output buffering to capture the output of the include and return it: function related_category_sidebar() { ob_start(); include WP_PLUGIN_DIR . ‘/sabai-directory/assets/templates/template_related_category.php’; return ob_get_clean(); } Then you will also need to do as Charles suggested and enable shortcodes for text widgets: add_filter( ‘widget_text’, ‘do_shortcode’, 11 );

Use shortcodes in custom metabox using wp_editor?

Figured it out: $team_information_value = get_post_meta( get_the_ID(), ‘team_information’, true ); // Checks and displays the retrieved value if( !empty( $team_information_value ) ) { echo do_shortcode($team_information_value); } else { echo ‘Value Not Fount or Empty’; } Put the displayed value (in this case $team_information_value) within a do_shortcode();

MathJax inside shortcode

You cant call a shortcode inside a shortcode they do not automatically nest, you need to use do_shortcode($content) like this (i am assuming the name of your shortcode): function alert_shortcode( $atts, $content = null ) { return ‘<div class=”alert alert-‘ . $atts[‘type’] . ‘” role=”alert”><p class=”alert-title”>’ . $atts[‘title’] . ‘</p>’ . do_shortcode($content) . ‘</div>’; }

Creating shortcode with parameter

Here’s an example of a [color] shortcode. If a parameter is specified, we assume (but verify) that it is a color. $content is then wrapped in <span> tags and the color is applied using inline styles. The color can be passed as a named color or hex color. Hex colors in 3 or six digits … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)