Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 6th, 2010  |  syntax: PHP  |  size: 0.50 KB  |  hits: 158  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //in-gallery div
  2. $photo_gallery_link = echo get_permalink($photo_page_id);
  3. $photo_gallery_slug = echo get_post($photo_page_id);
  4.  
  5. function photo_in_gallery_shortcode( $atts, $content = null ) {
  6.    extract( shortcode_atts( array(
  7.       'photo_page_id' => '1',
  8.       ), $atts ) );
  9.    return "<div class="in-gallery"><p style="text-align: left;">Gallery: <a href="$photo_gallery_link">$photo_gallery_slug</a></p>" . $content . '</div>';
  10. }
  11.  
  12. add_shortcode('photo_in_gallery', 'photo_in_gallery_shortcode');