• Hi,

    what I need to change to a file infobox-content.php, after clicking on the title of the opened image in lightbox. now open att attachment page.

    Code

    $link 		= ( 'none' !== $a['link'] ) ? '<a href="' . $link . '" rel="bookmark"'. $aclass .'>'. $title . '</a>': $title;
    
    	return '<'.$captiontag.' class="slidr-item-info">
    				<div class="slidr-info-hover">
    					<h2>
    						' . $link . '
    					</h2>' . $excerpt .
    				'</div>
    			</'.$captiontag.'>';

    https://www.ads-software.com/plugins/slidr/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi,

    Did you try slidr_custom_content( $link, $title, $excerpt, $a ) as described in the FAQ section? Search for the question “Instead of the title and excerpt I want to display my own content / metadata. Can I customize that output myself?”.

    If I understand the question correctly, perhaps this function could be of help to you.

    Thread Starter 2birds

    (@2birds)

    Thank You for answear.

    I wanna simple solutins for that:

    Now, when i click on image title i get this: https://example.com/sample-page/image-1/ – attechment page.

    I want this: https://example.com/wp-content/uploads/2016/05/image-1.jpg – the same like click on image.

    How to do this?

    It depends on how you use the shortcode. For example, if you use it in gallery mode, it should do what you want. I am copying the related part from the documentation:

    [slidr gallery=”yes”] : Instead of posts, the Carousel can be used in “Gallery mode” displaying the images attached to the post in which you call it. By default it is disabled. You can use gallery mode with specific images, by providing the IDs of those images like so: [slidr gallery=”1,2,3″]. If gallery mode is enabled, then other conflicting parameters such as post type or hide thumbnail will be ignored.

    [slidr gallery_link=”attachment”] : Whether each item’s link should lead to the attachment page or the actual media file if gallery mode is enabled. Default is the Media file. If gallery mode is set to “no” (disabled), then this setting is ignored.

    Thread Starter 2birds

    (@2birds)

    I used [gallery] code (wordpress gellery)
    In settings WordPress Gallery:
    Show additional information (namely, title and caption) on mouseover – YES
    Image link – YES.

    Look at page: https://ps.startinpoland.com.pl/ogrod-japonski/

    when you click on image – open a lightbox
    when you click on plus (it was a title of image, it’s my modification) -you go to attechment page, and i want to change for open a lightbox (the same when you click on image).

    I just saw your page and it seems that it works fine. I guess you figured it out yourself. Just out of curiosity, did you use the slidr_custom_content function or modified the plugin’s code?

    Thread Starter 2birds

    (@2birds)

    Unfortunately, I couldn’t do that ??

    Please look again: https://ps.startinpoland.com.pl/ogrod-japonski/

    Click on plus on the image, then you go to attechment page, but i want to open lightbox – just as click on image.

    Any ideas? ??

    I see,

    well, that depends on the html of the output and there is no easy way to achieve what you want. If the slidr_custom_content function doesn’t help, then perhaps you could create a custom loop (check some examples: https://demos.gsarigiannidis.gr/loop/)

    Thread Starter 2birds

    (@2birds)

    Thanks, can you help me with this?

    I think, that it is enough to change in the file infobox-content.php.

    Look. – this is standard

    $link 		= ( 'none' !== $a['link'] ) ? '<a href="' . $link . '" rel="bookmark"'. $aclass .'>'. $title . '</a>': $title;
    
    	return '<'.$captiontag.' class="slidr-item-info">
    				<div class="slidr-info-hover">
    					<h2>
    						' . $link . '
    					</h2>' . $excerpt .
    				'</div>
    			</'.$captiontag.'>';

    so i have to change in this line
    $link = ( 'none' !== $a['link'] ) ? '<a href="' . $link . '" rel="bookmark"'. $aclass .'>'. $title . '</a>': $title;

    Exactly <a>$link . '" rel="bookmark"'. $aclass .'>'. $title . '</a>
    to
    <a>here img_url . '" rel="bookmark"'. $aclass .'>'. $title . '</a>
    so what to put there?

    Thread Starter 2birds

    (@2birds)

    some advice?

    Actually I don’t think that changing the infobox-content.php will help you. I would try one of the options that I already mentioned (slidr_custom_content or custom loop). What you will insert there, though, depends on the actual content and how your gallery and lightboxes are created (e.g. via a plugin or some other way). This will require some PHP, though, and there might not be an easy way to do it.

    From what I can see in your link, the images’ links have a rel=”lightbox-gallery” attribute as well as a data-lightbox-gallery attribute, and they point directly at the image file. On the other hand, the “+” link contains no attributes and points at the attachment page instead of the image file. Perhaps if you give the appropriate attributes and URL to the “+” link it might work, but this is something that depends on the lightbox plugin that you use.

    Thread Starter 2birds

    (@2birds)

    Giorgos,

    Unfortunately , I still can not deal with it :(.

    But when i use code [slidr] it works well – look https://pracownia-soliter.pl/2016/05/31/547/
    but it doesn’t work a lightbox (i don’t now why?).

    Summarising, are You able to help me – we can settle?!

    Hi,

    I am afraid I can’t do much more, because it’s not something that depends entirely on the Slidr plugin. Slidr supports custom classes to its items for those who want to integrate some lightbox plugin, but the actual implementation is up to the developer and varies depending on the website’s specific theme or plugins.

    Thread Starter 2birds

    (@2birds)

    which file is responsible for the operation of sliders in such a way like this: https://goo.gl/Qaqau8. It’s {slidr] code.

    It’s not a single file. The code is broken down on files for convenience, but there are dependencies on different files.

    I don’t think that modifying the plugin’s core files will help you much and it’s a bad idea anyway because you will loose your changes on the next update.

    For full customization of the output there is the custom loop function that I mentioned earlier. Using it you can display almost anything you like (even videos or google maps), but this assumes that you already know how to create a php loop with the desired data.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Infobox-content click.’ is closed to new replies.