change image load behaviour
-
I would like to adjust a portolio behaviour that instead of it directing the user to a new page when clicked it should pop up an image using the Pretty photo Lightbox libraries https://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation/..
After analysing the code i realised it does the page rendering by calling a set of array parameters. I then checked another page on another website here: https://ambient.elated-themes.com/portfolio-item/inspiration-2/
and this was the behaviour i wanted.
Here is a code snippet of the arrays from my website
if ($query_results->have_posts()):
while ($query_results->have_posts()) : $query_results->the_post();$params[‘current_id’] = get_the_ID();
$params[‘article_classes’] = $this->getArticleClasses($params);$params[‘thumb_size’] = $this->getImageSize($params);
$params[‘text_holder_styles’] = $this->getTextHolderStyles($params);
$params[‘shader_styles’] = $this->getShaderStyles($params);
$params[‘text_inner_styles’] = $this->getTextInnerStyles($params);
$params[‘title_styles’] = $this->getTitleStyles($params);
$params[‘excerpt_styles’] = $this->getExcerptStyles($params);
$params[‘categories’] = $this->getItemCategories($params);
$params[‘switch_featured_image’] = $this->getSwitchFeaturedImage($params);
$params[‘category_html’] = $this->getItemCategoriesHtml($params);/* $params[‘item_link’] = $this->getItemLink($params);*/
NB: The commented out code is where the click in the gallery redirects you to another site, since after commenting out it stopped working.
Below is the code snippet of the image class from the working website above i want to use. How do i integrate this functionality?
<?php if(!empty($lightbox)) : ?>
” data-rel=”prettyPhoto[single_pretty_photo]” href=”<?php echo esc_url($media[‘image_url’]); ?>”>
<?php endif; ?>
” alt=”<?php echo esc_attr($media[‘description’]); ?>” />
<?php if(!empty($lightbox)) : ?><?php endif; ?>
Some ideas will do.
- The topic ‘change image load behaviour’ is closed to new replies.