how to create a proper query for getting a list of users with taxonomy related meta key

Objective I want to list sp_provider (hospital,clinics,doctors) whose sub_category is suppose ‘neurology’ rephrasing the words: I want to list users with sp provider category(meta value) such as “hospital” and the user have a sub category(meta value) “neurology” sp_provider is a meta value in user profile (sp-provider maybe a post-type or something for user management screen … Read more

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

Post the content of a specific “Custom Post Type” post within a post using a shortcode

I would suggest creating a new custom taxonomy for relations between a post and its “tracks” or grouping of track posts if you’d like that way you can easily create a shortcode that will query all the needed tracks at once using a shortcode instead of calling your shortcode over and over and to order … 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

How to format shortcode’s HTML in external file

function wpse450_show_video( $atts ) { extract(shortcode_atts(array( ‘id’ => 0 ), $atts )); if( is_numeric($id) ) { $ngvideo_title = get_the_title($id); } ob_start(); include ‘path/to/file/video.php’; return ob_get_clean(); } add_shortcode( ‘ngvideo’, ‘wpse450_show_video’ ); You can use $id, $atts in our file as you would in your function. The code in your file will behave just like it would … 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; }