logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$5
WP Gallery Thumbnail Issue

Hi,

My wordpress site http://vibrantstone.com/stoneportal/stones/slate-tile/ is based on following template/theme.

http://themeforest.net/item/bookcase-wordpress-portfolio-theme/630145?WT.ac=search_item&WT.seg_1=search_item&WT.z_author=2winFactor

When you open my site from this url.

http://vibrantstone.com/stoneportal/stones/slate-tile/

you would see peacock multicolor slate; upon expanding the image you would see thmubnails below.

To get thumbnails i use following gallery shortcode in post

[gallery id="46" link="file" columns="5"]

Also had updated theme functions.php with this code to get the gallery slides working in page.

add_filter( 'wp_get_attachment_link','bot_prettyadd');

function bot_prettyadd ($content) {
$content = preg_replace("/<a/","<a rel=\"prettyPhoto[slides]\"",$content,1);
return $content;
}


Issue I have is when you click on thumbnails of peacock multicolor slate and lightbox popup you would see thumbnails from other expanding image under " Sandstone Crate Packing". I want to avoid them getting under peacock slate expansion. This is happening across my site.

Internal pages are working fine at here http://vibrantstone.com/stoneportal/portfolio/peacock-multicolor-slate/.


Need resolution to issue having on main page thumbnails.

Thanks
Sintl



sintl | 12/15/11 at 12:00pm Edit
Tutorial: How to assign prize money


(3) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    12/15/11
    12:41pm
    Francisco Javier Carazo Gil says:

    Hi Sintil,

    Does the plugin support two different kinds of image in the same page?

    I think no and that's the problem. Maybe you should change something in class or image to be able to do this.

    Later I will see the reference of plugin.

    • 12/15/11 1:06pm

      sintl says:

      I am not very good at coding; not sure what changes to be made.

      Since the theme brings multiple post on a single page. Gallery short code is referencing all images of various post and that is causing it to mix all in 1 gallery. Where as if reviewed on single post it is working fine.

      So change has to be applied in filter code how to avoid thumbnails of different post on same single page when expanded image.

    • 12/15/11 3:40pm

      sintl says:

      Resolved,

      I am just a user, do not have coding knowledge.

      my issue got resolve when I used following filter from http://wordpress.org/support/topic/gallery-shortcode-for-rel-tag



      // Adapted and Modified from http://wordpress.org/extend/plugins/add-lightbox/
      // Adds a rel="prettyPhoto" tag to all linked image files

      add_filter('the_content', 'addlightboxrel_replace', 12);
      add_filter('get_comment_text', 'addlightboxrel_replace');
      function addlightboxrel_replace ($content)
      { global $post;
      $pattern = "/<a(.*?)href=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i";
      $replacement = '<a$1href=$2$3.$4$5 rel="prettyPhoto['.$post->ID.']"$6>$7</a>';
      $content = preg_replace($pattern, $replacement, $content);
      return $content;
      }

      Thnks
      Sintl

    • 12/16/11 4:29am

      Francisco Javier Carazo Gil says:

      Hi Sintl,

      Perfect. Any more problem?

  • avatar
    Last edited:
    12/15/11
    11:03pm
    Arnav Joy says:

    did you checked all the options aat backend , there may be a option to prevent these extra images from the thumbnail lightbox.

  • avatar
    Last edited:
    12/16/11
    1:38am
    Julio Potier says:

    Hello

    In your function try to insert $post->ID instead of "slides"

    function bot_prettyadd ($content) {
    $content = preg_replace("/<a/","<a rel=\"prettyPhoto[slides]\"",$content,1);
    return $content;
    }


    kind of

    function bot_prettyadd ($content) {
    global $post;
    $content = preg_replace("/<a/","<a rel=\"prettyPhoto[{$post->ID}]\"",$content,1);
    return $content;
    }


    See you

    • 12/17/11 3:36pm

      sintl says:

      I tried using the function but it stopped the lightbox effect as well gallery.

      thnx

    • 12/17/11 3:39pm

      sintl says:

      My issue is already resolved so i am good just that wanted to let you know that suggestion did not work at my end.

      thnx

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.