Caption shortcodes not including caption as attribute

Find the line /* Remove in-line styling in function.php. Comment out: /* add_shortcode(‘wp_caption’, ‘fixed_img_caption_shortcode’); add_shortcode(‘caption’, ‘fixed_img_caption_shortcode’); function fixed_img_caption_shortcode($attr, $content = null) { // Allow plugins/themes to override the default caption template. $output = apply_filters(‘img_caption_shortcode’, ”, $attr, $content); if ( $output != ” ) return $output; extract(shortcode_atts(array( ‘id’=> ”, ‘align’ => ‘alignnone’, ‘width’ => ”, ‘caption’ … Read more

Check if post has gallery images/media

No Need for SQL queries in the template. function wpse_72594_get_attachments( $id, $mime=”” ) { $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => $mime, ‘post_parent’ => $id ); $attachments = get_posts($args); if ($attachments) return $attachments; return false; } Then call the function like this (300 is the post ID): wpse_72594_get_attachments(300), grabs all attachments wpse_72594_get_attachments(300, ‘image’ ), … Read more

shortcode_atts – one URL variable not working

First of all, you’re using extract / shortcode_atts in correctly: The line: extract(shortcode_atts(array( “li” => get_option(‘li’), ), $liatts)); uses shortcode_atts and then extracts turns each key in the returnarray into its own variable: e.g. $li in this example. But you then go onto use $liatts anyway – which is just the attributes passed from the … Read more

How to get gallery id inserted to a post?

In single.php i put this code, from this link (thank you Wyck) https://stackoverflow.com/questions/14277794/wordpress-3-5-own-gallery-with-included-images-doesnt-work preg_match(‘/\/’, $post_content, $ids); $array_id = explode(“,”, $ids[1]); print_r($array_id); Now I can use gallery shortcode

Shortcodes and a list of IDs?

explode will be your best option. WordPress has a few built in functions to handle arrays of function arguments (wp_parse_args and shortcode_atts for example), but nothing relating to splitting a string and iterating the result. It’s not entierly clear to me what you are trying to achieve, but let’s say you were trying to get … Read more

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