Viewing 30 posts - 1 through 30 (of 32 total)
  • Author
    Posts
  • #605779

    I would like to have all my portfolio items open to a lightbox larger image rather than a new page. I need the filter feature of the portfolio so I cannot use the masonry gallery. I am able to get them to open by adding a link to the large image but I will have hundreds of images and am concerned that when the site goes live and the URL changes to the final one the links will all need updated. Is there a way to enter something in the field that will dynamically call in the large image id based on the portfolio item? or is there a way to change how the portfolio works so that all portfolio items open to lightbox rather than a new page?

    #605785

    Hi!

    Is there a way to enter something in the field that will dynamically call in the large image id based on the portfolio item

    You mean the full version of the feature image? can you post a link to what you have right now?

    Cheers!
    Josue

    #605796

    All images open to a new page except the last image in the top row “Walnut” …. I put the URL of the feature image in the field. I would like to have them work like the masonry gallery but still filter but that is not possible is it? If not I would like to have all of them just open the large image of the feature image. Thanks.

    #605814

    Hi,

    Open /config-templatebuilder/avia-shortcodes/helper-masonry.php and look for line:

    if($custom_link) $this->loop[$key]['url'] = $custom_link;
    

    Replace it by this:

    if($custom_link) $this->loop[$key]['url'] = $custom_link;
    $this->loop[$key]['url'] = wp_get_attachment_image_src($id, 'full');

    Regards,
    Josue

    #606016

    I made these changes and they are not working. On http://teddwoodcustomcabinetry.com/beta/doors/ … it does not open the door pages and they are set to the default setting. On http://teddwoodcustomcabinetry.com/beta/cabinetry-option/yellowstone-door/ …. none of the default settings open, in the second row Quarter Sawn White Oak is set to a custom link (the field is blank) link to large image is not working and the Walnut is set to a custom link with the field containing a direct link to the full image and it will not open. When I look in the code the href is empty in all cases.

    Hoping I didn’t do what you asked wrong. Let me know. Thanks.

    #606035

    I submitted 2 questions and question – #605793 – was replied to and they asked me to update the enfold theme which I am doing so the change I did for this question I reverted back to the original file while I make the update to the theme.

    #606147

    Hi!

    Place this line instead:

    $this->loop[$key]['url'] = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full')[0];
    

    Regards,
    Josue

    #606390

    This does make the portfolio links open the large image with lightbox. It does not limit it to custom links though it does it for the default and custom links. Is there a way to make it only apply to empty custom links? Thanks.

    #606401

    Change the whole block to:

    $custom_link = get_post_meta( $id ,'_portfolio_custom_link', true) != "" ? get_post_meta( $id ,'_portfolio_custom_link_url', true) : false;
    if($custom_link) {
    	$this->loop[$key]['url'] = $custom_link;
    }else{
    	$this->loop[$key]['url'] = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full')[0];	
    }
    #606403

    I get the same results.

    #606408

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #606413

    Here is the access. Thanks.

    #606649

    checking to see if you have an update for me?

    #606977

    Hi!

    Please set the user as an administrator.

    Regards,
    Josue

    #607321

    Sorry. Thought it was set as an admin. It is now.

    #608184

    The modification seems to be working as expected, i set a custom URL to the “Walnut” item and it did linked to it.

    #608313

    The modification has made it that if you have it set at default or at custom … they both open lightbox. On the default setting I wanted it to open the link to the page. Right now I have them all set to custom so I can put the page link in for it to work but I will have to go back and change them all if there are changes to the URL.

    #608316

    This page all needs to open the pages http://teddwoodcustomcabinetry.com/beta/doors/ …. all are set to custom right now for that to work.

    But when you are on one of the pages like http://teddwoodcustomcabinetry.com/beta/cabinetry-option/alameda-door/ all the door options need to open the larger image

    #608575

    Hey!

    I’m afraid i don’t quite understand what you want here, you mean some grids should have the modification and some don’t?

    • Un-modded: default: permalink if no custom link is set
    • Modded: default: full featured image if no custom link is set

    Regards,
    Josue

    #608578

    My hope was ….

    Modded:
    default – permalink
    custom left blank – feature image lightbox
    custom with entry – whatever is entered.

    This way the URLs would almost always be dynamic whether it was to the permalink or the lightbox.

    Thanks – sorry for any confusion.
    Renita

    #608597

    Ok try with this:

    					if($custom_link != ''){
    						    $this->loop[$key]['url'] = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full')[0]; // custom link toggled, link featured img
    						}elseif($custom_link_url != ''){
    						    $this->loop[$key]['url'] = $custom_link_url; // custom link toggled and URL set, link to URL.  
    						} else {
    						    $this->loop[$key]['url'] = get_permalink($id);
    						}
    

    Should work in the three cases as follows:
    1. http://screencast.com/t/lU2XxtTfuGPf
    2. http://screencast.com/t/07k7pJVzh
    3. http://screencast.com/t/R1wXyIM97cit

    • This reply was modified 8 years, 7 months ago by Josue.
    #608630

    Here is what I replaced:

    if(!post_password_required($id)){
    $custom_link = get_post_meta( $id ,’_portfolio_custom_link’, true) != “” ? get_post_meta( $id ,’_portfolio_custom_link_url’, true) : false;
    if($custom_link) $this->loop[$key][‘url’] = $custom_link;
    }

    This is what I replaced it with:

    if(!post_password_required($id)){
    $custom_link = get_post_meta( $id ,’_portfolio_custom_link’, true);
    $custom_link_url = get_post_meta( $id ,’_portfolio_custom_link_url’, true);

    if($custom_link) $this->loop[$key][‘url’] = wp_get_attachment_image_src(get_post_thumbnail_id($id), ‘full’)[0]; // custom link toggled, link featured img
    if($custom_link_url) $this->loop[$key][‘url’] = $custom_link; // custom link toggled and URL set, link to URL.
    }

    All custom links are broke – they go to ../custom
    The blank custom field do open the image lightbox
    The default opens the light box too … not the permalink.

    #608631

    The screen shots you did are what I am looking for but the code didn’t make it happen.

    Thanks,
    Renita

    #608821

    I’ve modified the code a bit, can you check it now.

    #609044

    That didn’t work either but I took the different ones you sent and compared what worked and didn’t from each and came up with this ….

    if(!post_password_required($id)){
    $custom_link = get_post_meta( $id ,’_portfolio_custom_link’, true);
    $custom_link_url = get_post_meta( $id ,’_portfolio_custom_link_url’, true);

    if($custom_link) $this->loop[$key][‘url’] = wp_get_attachment_image_src(get_post_thumbnail_id($id), ‘full’)[0]; // custom link toggled, link featured img
    if($custom_link_url) $this->loop[$key][‘url’] = $custom_link_url; // custom link toggled and URL set, link to URL.
    }

    This seems to work … do you see anything that would cause problems?

    Thanks,
    Renita

    #609083

    The only thing I found is that when you had the portfolio item previously set to a custom URL and you switch back to the default …. it still uses the custom URL that was in there.

    I have to delete the custom URL, save it so it is blank and then switch it to default.

    I can live with that since I typically don’t have custom URLs … but thought I should post it if anyone is looking for a similar modification.

    If there is a fix for the code though I would try it. I am just not sure what to change to fix it.

    Renita

    #609503

    That probably happens because even custom URL is “off” the post_meta value is still there so the 2nd conditional still runs, try changing it to:

    if($custom_link_url && $custom_link) $this->loop[$key][‘url’] = $custom_link_url; // custom link toggled and URL set, link to URL.
    

    Best regards,
    Josue

    #620903

    I have a child theme installed but when the enfold theme updates this is overwrote. How can I put this page in my child theme folder and have it pull from there? or is that not a good idea?

    #620909

    I believe I have this figured out.

    #621293
Viewing 30 posts - 1 through 30 (of 32 total)
  • The topic ‘masonry portfolio lightbox links’ is closed to new replies.