Forums

Add Fancybox to Twentyten Theme Images (2 posts)

  1. foochuck
    Member
    Posted 1 year ago #

    Hello,

    I'm trying to add the "Fancybox" lightbox alternative to my WordPress site that is powered by the Twentyten Them. Basically when images are added to a page in a gallery, I'd like the images to be opened in Fancybox when you click on a thumbnail.

    Basically I need to add this to the a href tag: rel="fancybox"

    Is this an update I make in media.php? If so, could someone point me in the right direction for documentation on how to add this?

    Thanks!

    -foo

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You need to edit attachment.php. specifically, try changing:

    sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',

    to:

    sprintf( '<a rel="fancybox" href="%1$s" title="%2$s">%3$s &times; %4$s</a>',

    But be warned that your customisations will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

Topic Closed

This topic has been closed to new replies.

About this Topic