gutenberg widget outputting paragraph marks

Does anyone have any idea what is causing the extra paragraph marks before and after? The Shortcode block performs wpautop() on the content (in the block) before the shortcode is parsed (see source on GitHub), i.e. wpautop( ‘[show-test]’ ) in your case, which then returns <p>[show-test]</p> and then outputs <p><div>hi there.</div></p> after the shortcode is … Read more

Create a shortcode in WordPress, again

// Declare your shortcode add_shortcode(“download”, “downloadFunction”); // Second Declare your shortcode function function downloadFunction($att, $content, $code){ // your function is passed 3 Arguments // $atts : this is an array of the shortcode’s attributes // $content : this is the content between the code. in your case the file url. // $code : this is … Read more

getting values from a shortcode with an include

include changes the scope. You would need to declare $classslider global before defining it, and then use global $classslider; before using it. function bf_shortcode_slideshow($atts) { global $classslider; extract(shortcode_atts(array( … I think that will fix your problem. I don”t understand why you are using include at all though. There must be a better way to make … Read more

Adding short codes from a page’s content on header and hiding the same from page’s content

This might work for you, trying to hook early to the_content filter to strip the shortcode tag from it: add_filter(‘the_content’, ‘ad_filter_the_content’,1,1); function ad_filter_the_content($content) { // specify page id or array of page ids to include if (is_page(5)) { return str_replace(‘[orbit-slider category=”test”]’, ”, $content); } return $content; }

How to link to a page that has a shortcode?

Transients are probably not the way to go here. From what I understand: You want to know if a post has a shortcode by doing some form of look up You want to be able to get a list of permalinks / posts that have this shortcode. Here’s what I suggest. /** * Checks for … Read more

Legacy Audio Shortcode

If your only issue is that the format is incorrect then switch it in the_content hook with the correct version. Non-local content: Place in a plugin or functions.php // hook earlier than 10 add_filter(‘the_content’, ‘wpse_20160110_the_content_fix_audio’, 0); function wpse_20160110_the_content_fix_audio($content){ return str_replace ( ‘[audio:’, ‘[audio src=”https://wordpress.stackexchange.com/questions/214052/, $content ); }

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