How to display the comment_form with a shortcode while removing it from its default position?

Version #1 The following seems to work for the Twenty Fifteen theme: /** * Display the comment form via shortcode on singular pages * Remove the default comment form. * Hide the unwanted “Comments are closed” message with CSS. * * @see http://wordpress.stackexchange.com/a/177289/26350 */ add_shortcode( ‘wpse_comment_form’, function( $atts = array(), $content=”” ) { if( is_singular() … Read more

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 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

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

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

Wraping $content into link with shortcodes

This is a filter in WordPress called wpautop it is there to make formatting cleaner when publising posts, however when you want more control over formatting it can be a pain. It basically wraps returns in paragraphs so that the space you see in the editor is obeyed on the front end. You can disable … Read more

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