Anchor text in Short code →

I think you just need to add link_url to the shortcode, like so? [tm_single_image animation=”fadeInLeft” classname=”sub-banner1″ image=”http://trafficspinners.com/wp-content/uploads/2016/11/wedding-seating-chart-downloadable2.jpg” link_url=”YOUR-LINK-HERE”] Unless I am not understanding what you mean by ‘clickable anchor text’.

add new attributes into existing shortcodes

All you need to do is modify the $a-variable, for example, to add a target to this link, you would add it to the array making up the $a-var, and printing it later. add_shortcode( ‘button’, ‘btn_shortcode’ ); function btn_shortcode($atts, $content = null) { $a = shortcode_atts(array( ‘class’ => ‘button’, ‘href’ => ‘#’, ‘target’ => ‘_blank’ … Read more

PHP error with a shortcode: “no suitable wrapper” for file_get_contents

Use the HTTP API: $http = wp_remote_get( ‘https://en.wikipedia.org/w/api.php?action=query&titles=Test_article&prop=revisions&rvlimit=1&format=json’ ); if ( ! $body = wp_remote_retrieve_body( $http ) ) return; if ( ! $data = json_decode( $body, true ) ) return; $date = new DateTime( $data[‘query’][‘pages’][‘746140638’][‘revisions’][0][‘timestamp’] ); return $date->format( ‘m-d-Y’ );

Add div on EMED Tag

you can use ’embed_oembed_html’ to wrap that iframe inside the div. add_filter(’embed_oembed_html’, ‘Oembed_youtube_no_title’, 99, 4); function Oembed_youtube_no_title($html, $url, $attr, $post_id) { return ‘<div class=”embed-container”>’ . $html . ‘</div>’; } Didn’t test please let me know if it works for you.

Get Image Having the ID [closed]

Put the below code in your functions.php and then you can use this [get_image_by_id id=”your-image-id”] shortcode to get the image add_shortcode( ‘get_image_by_id’, ‘the_dramatist_get_image_by_id’); function the_dramatist_get_image_by_id($atts) { return wp_get_attachment_image($atts[‘id’]); } Here “your-image-id” is numeric ID of the image. Hope that helps.