Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21911

    Hello,

    I want to disable the lightbox (and the link) of the main image inside the portfolio pages.

    I see that if I select in the media options “No Link” i get this correctly disable however is also disable the link to the image in the portfolio category where people can select what work they want to see… and this is not very usable…

    So what I need is to have the link correctly to the post when I click on the image in the portfolio category but when I am inside the portfolio single page I dont want any link in the featured media.

    How can I get this working?

    #2 I have another problem. My images in the portfolio automatically when I upload them the system create a new image with the size 1138x640px but the natural size or my images is 1140×641. There is a way to say to the system that the size or my images is 1140x640px in order to don’t have this new image size of 1138×640?

    Thank you so much.

    #113538

    Hi,

    Sounds like you never want to have a lightbox on the portfolio item page , but just on the thumbnail page if you select the lightbox option when making the page. If that’s the case then whenever you select lightbox option , that is how it will function only on portfolio item page.

    a) Please open /includes/helper-slideshow.php and find line 335-339 ( i moved things around a bit so i might be off by a few lines, but there is only 1 block of code on that page that looks like that (on the page there will be indentations that i removed here:

    =============================================================

    }else
    {
    $image = "<a href='".$this->link_overwrite."'>".$image_string."</a>";
    }
    }

    and *replace* the above lines with the code below

    elseif ("slay link" === $this->link_overwrite)
    {
    $image = $image_string;
    }
    else
    {
    $image = "<a href='" . $this->link_overwrite . "'>" . $image_string . "</a>";
    }
    }

    =============================================================

    b) Now please open up /includes/loop-portfolio-single.php and look for line 28 that looks like

    <?php if($slider->slidecount) echo $slider->display(); ?>

    and replace that line with the code below

    <?php

    if($slider->slidecount) {
    $slider -> link_overwrite = "slay link";
    echo $slider->display();
    }

    ?>

    =============================================================

    c) in file /includes/admin/register-admin-metabox.php find line 224 that looks lke

    "subtype" => array('No link'=>'','Open Lightbox when clicked'=>'lightbox','Link to this Post'=>'self','Link to Page'=>'page','Link to Category'=>'cat','Link manually'=>'url'),

    and replace it with

    "subtype" => array('No link'=>'','No Link On Portfolio Item Only'=>'half-lightbox','Open Lightbox when clicked'=>'lightbox','Link to this Post'=>'self','Link to Page'=>'page','Link to Category'=>'cat','Link manually'=>'url'),

    =============================================================

    d) please open up framework/php/function-set-avia-frontend.php and find lines 559-561 that look like

    case "lightbox":
    $url = avia_image_by_id($option_array[$keyprefix.'image'], array('width'=>8000,'height'=>8000), 'url');
    break;

    and replace them with the lines below

    case "lightbox":
    case "half-lightbox":
    $url = avia_image_by_id($option_array[$keyprefix.'image'], array('width'=>8000,'height'=>8000), 'url');
    break;

    =============================================================

    So now when you add image on the page a new option for image properties will show up ‘No Link On Portfolio Item Only’ and if you select it , there will be no lightbox on the main image page and no link., but the main portfolio page with thumbnails will have as before.

    **Just be aware that theme updates will overwrite the above solution.

    ===================

    ====================

    =====================

    2.

    Thanks,

    Nick

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Disable lightbox inside portfolio pages’ is closed to new replies.