Results 1 to 6 of 6

Thread: Plugin to add a lightbox only to chosen post images or by custom post type

  1. #1
    aaronjpitts is offline Hello World
    Join Date
    Jun 2010
    Posts
    4

    Default Plugin to add a lightbox only to chosen post images or by custom post type

    Is there a plugin which can make an image in a post use a lightbox (or similar), the only plugins I have found so far will add a lightbox to images in all posts, I want to be able to choose by each individual post what images to add to a lightbox or to be able define a lightbox by a custom post type (im using WP 3.0).

    Thanks

  2. #2
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by aaronjpitts View Post
    Is there a plugin which can make an image in a post use a lightbox (or similar), the only plugins I have found so far will add a lightbox to images in all posts, I want to be able to choose by each individual post what images to add to a lightbox or to be able define a lightbox by a custom post type (im using WP 3.0).

    Thanks
    I use Lightbox 2.

    The plugin has an option "Auto-lightbox image links".

    Simply un-check (disable) this option. Then, for any image you want to appear in a Lightbox, just add rel="lightbox" to the image link anchor tag.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  3. #3
    aaronjpitts is offline Hello World
    Join Date
    Jun 2010
    Posts
    4

    Default

    I was just wondering if there was a way to do this without having to manually edit the anchor tag, as I am trying to set up Wordpress as a CMS for a client that will want to add images themselves and not change code.

    Thanks

  4. #4
    C3MDigital's Avatar
    C3MDigital is offline Hello World
    Join Date
    Mar 2010
    Location
    Houston, TX
    Posts
    45

    Default Try Fancybox

    I would suggest using Fancybox . It is very easy to work and I would suggest adding manually to the theme rather than using the plugin. To target all images with an a tag your code would be:

    Code:
    $("a:has(img)").fancybox();
    To target all images within a certain post type you could use the is_post_type($post_type) conditional tag

    I am using it on this site to pull custom posts into a fancybox.

  5. #5
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by aaronjpitts View Post
    I was just wondering if there was a way to do this without having to manually edit the anchor tag, as I am trying to set up Wordpress as a CMS for a client that will want to add images themselves and not change code.

    Thanks
    Well, there has to be some middle ground somewhere:

    a) Let the plugin apply Lightbox to all post images
    b) Don't apply Lightbox to any post images
    c) Have some way of indicating which images should have Lightbox applied

    Scenario C doesn't require code-editing; just image-editing. Edit the image, go to the Advanced tab, and enter rel="lightbox" in the "Rel" field.

    I'm not sure it gets much easier than that - unless you're looking for a plugin that gives the user a checkbox in the edit image dialogue, or something?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  6. #6
    hakre's Avatar
    hakre is offline Here For The Peanuts
    Join Date
    Jun 2010
    Posts
    129

    Default

    Quote Originally Posted by aaronjpitts View Post
    I am trying to set up Wordpress as a CMS for a client that will want to add images themselves and not change code.
    WordPress CMS features are acutally pretty limited and you just crossed such a limitation.

    I could imagine that it is possible to extend the image properties dialog with a checkbox which then takes care of adding / removing rel="lightbox" as suggested. That made your customer would not need to deal with "code" for those images but by clicking with the mouse instead. Would that look like what you are looking for for your customer?
    hakre on wordpress (clicking this all three minutes help to keep the cache fresh - thanks)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •