Gallery shortcode menu order fix no longer working on WordPress 4.0

What I found to work for me was to remove the action within the foreach ending with the following code function pmc_gallery_menu_order_fix($id) { $regex_pattern = get_shortcode_regex(); preg_match (“https://wordpress.stackexchange.com/”.$regex_pattern.’/s’, stripslashes($_POST[‘content’]), $regex_matches); if ($regex_matches[2] == ‘gallery’) : $attribureStr = str_replace (” “, “&”, trim ($regex_matches[3])); $attribureStr = str_replace (‘”‘, ”, $attribureStr); $attributes = wp_parse_args ($attribureStr); endif; $ids … Read more

How to list all active and specific shortcodes in wordpress

The conditional needs to test against strings which would be the name of the shortcode. If you’re looking for the [hello] shortcode the conditional would look like: echo ‘<pre>’; print_r( $shortcode_tags[‘hello’] ); echo ‘</pre>’; So if you use add_shortcode() the string you’ll be looking for is the first parameter: $tag.

Specific loop in Shortcode

Ok mate – i got you… you should really break into 2 shortcodes. One as a wrapper (which is really short) and the other for the content… Example: add_shortcode(‘servicewrap’, ‘service_wrapsc’); function service_wrapsc($atts, $content = null) { return ‘<div class=”service”><div class=”container”><div class=”row”>’.do_shortcode($content).'</div></div></div>’; } add_shortcode(‘servicesingle’, ‘service_singlesc’); function service_singlesc($atts, $content = null) { extract(shortcode_atts(array( ‘icon’ => ‘fa-briefcase’ ), … Read more

How to link to a alternative page in CSS

Two options. The first would be as you said to determine the browser size using javascript. Then have your code do something where it changes the link if the browser us either above or below a certain size. The second, and this may be your preferred method, would be to use css. If your theme … Read more

post meta value as shortcode parameter

// hijack the download shortcode add_shortcode( ‘dlm_gf_form’, array( $this, ‘shortcode_dlm_gf_form’ ) ); This line just adds a shortcode from a class. I checked this plugin’s class and they didn’t provide any actions or filter. You can try to modify original code of this plugin for your purposes only. I don’t see any other solution. I … Read more

template_redirect to accompany with a shortcode

The answer below doesn’t directly answer your question but provides a possible alternative solution. Drop has_shortcode( $post->post_content, ‘my-shortcode’ ) statement. There is no need to check this if you are validating nonce. So the validation should look something like this. function project_registration_login_redirection(){ if ( !isset( $_POST[‘my_submit’] ) ) { return; } // form validation here … Read more

Stream Video Player does not work with do_shortcode()?

It’s not really a shortcode, its a content filter but you can try calling the plugins function directly: if (function_exists(‘StreamVideo_Parse_content’)){ echo StreamVideo_Parse_content(“[stream flv=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 mp4=xxx.es/wp-content/uploads/2011/04/VIDEO-UE.mp4 provider=video img=xxx.es/wp-content/uploads/2011/04/previo-video.jpg embed=false share=false width=500 height=333 dock=true controlbar=over bandwidth=high autostart=false opfix=true /]”); }

Is it possible not to define category on function.php and add the shortcode [shortcode cat=1] to display the products?

You can use shortcode_atts for get your category which you are pass in [home_slider cat=1]. I assume that your taxonomy is category. you can replace with your taxonomy. You can also pass multiple cat id using comma separated. for eg [home_slider cat=1,2,3]. It will return slider of that category post. function home_slider($params = array()){ extract(shortcode_atts(array( … Read more