Insert Custom HTML After Shortcode

I wonder if you could override the [rev_slider] with this kind of wrapper: add_shortcode( ‘rev_slider’, function( $atts = array(), $content=”” ) { $html=””; // Your custom banner HTML $banner=”<div id=”bannerHTML”><!– banner HTML goes here –></div>”; // Append your banner HTML to the revslider’s output if( function_exists( ‘rev_slider_shortcode’ ) ) $html = rev_slider_shortcode( $atts, $content ) … Read more

Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

this is very simple to do… // next function next_shortcode($atts) { // global $post; -unnecessary return ‘<div class=”nav-next”>’.next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( ”, ‘Next post link’, ‘ ‘ ) . ‘</span>’,true ).'</div>’; } add_shortcode( ‘next’, ‘next_shortcode’ ); //prev function prev_shortcode($atts) { //global $post; -unnecessary return ‘<div class=”nav-previous”>’.next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( … Read more

Wordspress add into my javascripts

You have to either 1) take all the whitespace out of the script so WordPress does not add <p> tags and then the JS will work, or 2) disable autop in the post editor for all posts/pages (see http://codex.wordpress.org/Function_Reference/wpautop ) so WP doesn’t add paragraph breaks, or 3) do the following, which leaves autop enabled … Read more

Featured image shortcode

Register the shortcode, ideally in a plugin or functions.php if you have to. add_shortcode(‘thumbnail’, ‘thumbnail_in_content’); function thumbnail_in_content($atts) { global $post; return get_the_post_thumbnail($post->ID); } Add the shortcode to you post content. [thumbnail] If you want more features, see this post or the pastebin. ADDING CAPTIONS AND LINKS add_shortcode(‘thumbnail’, ‘thumbnail_with_caption_shortcode’); function thumbnail_with_caption_shortcode($atts) { global $post; // Image … Read more

Get shortcode name from within it’s callback function? [duplicate]

The shortcode’s name is referred to as the tag. The tag is actually the 3rd (and last) parameter passed to the shortcode’s callback function. So your callback should look something like this: function print_shortcode($atts, $content, $tag) { // $atts – array of attributes passed from shortcode // $content – content between shortcodes that have enclosing … Read more

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