How to make a shortcode with a line break in it parse correctly?

There are two workaround options I’ve found: Workaround 1: You can use an indiscriminate number of non-breaking spaces where you would like a line break. So to imitate this: [shortcode paraA1=’789′ paraB1=’987′ paraA2=’890′ paraB2=’098′ paraA3=’901′ paraB3=’109′ ] You can enter: [shortcode paraA1=’789′ paraB1=’987′ paraA2=’890′ paraB2=’098′ paraA3=’901′ paraB3=’109′ ] The WordPress text editor will wrap the … Read more

Shortcode or Template Page

Actually it depends. If you’re adding the functionality through a custom plugin or any third party solution rather than theme then the shortcode is best, otherwise you can use a template. You also can use template file with plugin, but then the theme and the plugin will be tightly coupled. That’s kinda not preferred. But … Read more

Get current category and place it in shortcode

So, you can get the category name with get_queried_object()->name: if ( is_category() ) { echo do_shortcode( ‘[x_recent_posts type=”post” count=”2″ offset=”” category=”‘ . get_queried_object()->name . ‘” orientation=”vertical” no_sticky=”true” no_image=”false” fade=”false”]’ ); }

How to add a shortcode to an HTML image tag

Use a separate function to enable shortcodes in the text widget because trying to do so within the shortcode function itself is too late. // Enable the use of shortcodes within the text widget. function wpse249090_widget_text_enable_shortcodes() { add_filter( ‘widget_text’, ‘do_shortcode’ ); } add_action( ‘init’, ‘wpse249090_widget_text_enable_shortcodes’ ); // Do TimeStamper Shortcode ( timestamper() ) function timestamper( … Read more

How do i remove Business feeds Shortcode fatal error

This is probably the issue: $currency = wp_remote_get($current_ping); if($currency){ $currency will either be a WP_Error object or an array. Checking if($currency) will be true in both cases. Instead, you should check if it’s an array and not an error object: if ( is_array( $currency ) && ! is_wp_error( $currency ) ) { of course, that … Read more

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