Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created August 8, 2012 08:06
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save corsonr/3293334 to your computer and use it in GitHub Desktop.
Save corsonr/3293334 to your computer and use it in GitHub Desktop.
simple trick to add rel attribute to wordpress gallery
@dpvue
Copy link

dpvue commented Sep 21, 2014

Any idea how to add title attribute in order for prettyphoto to display photo description? I have tried with this: return str_replace('<a href', '<a title="' . get_the_title() . '" rel="prettyPhoto[pp_gal]" href', $link);, but i get the post title, not the attachment title!

@mpotvin
Copy link

mpotvin commented Nov 19, 2015

Where should I put this line of code. Pretty please

@rob-st
Copy link

rob-st commented Jun 2, 2016

Nice one, thanks. Still working with WP 4.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment