Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode('wp_caption', 'special_img_caption_shortcode');
- add_shortcode('caption', 'special_img_caption_shortcode');
- function special_img_caption_shortcode($attr, $content = null) {
- //mod alchymyth 2011 // 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' => ''
- ), $attr));
- if ( 1 > (int) $width || empty($caption) )
- return $content;
- if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
- $frame_width = 5; // frame width in pixels per side //
- $output = '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . ( 2 * $frame_width + (int) $width) . 'px">'
- . do_shortcode( $content );
- /*buy link, date, tags, title*/
- $output .= '<p class="wp-caption-buy">BUY PRINT | BUY CARD | SHARE</p>';
- $output .= '<p class="wp-caption-special">POSTED ' . get_the_time('F j, Y') . ' | TAGS: <span>' . get_the_tag_list("", " // ", "") . '</span></p>';
- $output .= '<p class="wp-caption-text">' . $caption . '</p></div>';
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement