no content after shortcode

You forgot the closing </audio> tag at the end. function html5_audio($atts, $content = null) { extract(shortcode_atts(array( “src” => ”, “preload”=> ‘none’, “loop” => ” ), $atts)); return ‘<audio src=”‘.$src.'” preload=”‘.$preload.'” loop=”‘.$loop.'” /></audio>’; } add_shortcode(‘audio’, ‘html5_audio’);

How to split text text text into array

Firstly, you need to remove the paragraph tags that were added by the wp_autop filter. There’s another answer that covers this pretty well: Is there an uw-wp_autop function? I’m going to change the function a little for our purposes (based on the markup example you gave): function reverse_wpautop( $s ) { // Strip newlines $s … Read more

How do I write this shortcode? [closed]

function webhosting_products_shortcode( $atts, $content = null) { ob_start(); include(‘shortcodecontent.php’); $shortcode = ob_get_clean(); return $shortcode; } add_shortcode(‘webhosting’, ‘webhosting_products_shortcode’); Improvements include: Your html is now in a separate file, and can be written as is, rather than as a long PHP string Trailing whitespace is bad, untidy, and should be highlighted by your code editor to point … Read more

Registration Form Shortcode

do_action(‘register_form’); doesn’t echo the form. It runs inside the form. You can use it to add information or maybe alter some values… maybe. So the answer is that you can’t insert the registration form with that mechanism. And while there are function in wp-login.php, the form isn’t one of them. What you probably want is … Read more

Get post object in shortcode function

You need to reassign the $post yourself. See the WordPress Codex that setup_postdata won’t do it for you. Try this: global $post; $section_id = 16; $post = get_post( $section_id ); setup_postdata( $post ); the_content();

Passing html tags as shortcode parameters

When I create shortcodes that accept html tags i only take the tag name, meaning that if the tag is <h3> then i ask the user to enter h3 and i add the <, </ and > in the shortcode handler ex: extract( shortcode_atts( array( ‘count’ => -1, ‘category_name’ => ”, ‘q_tag’ => ‘h3’, ‘orderby’ … Read more

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