Before you ask please READ THIS

Target blank

Hello,

Here is my website www.healthwebdesign.com
Could you tell me how to make a target blank on "Our Work"?
When I click the picture, I want to open a new tab.


Thank you!

Comments

  • AirAir
    Posts: 10,970
    Hello :-)

    There is no such option for the works list. However, you could insert normal Album instead with shortcode https://rifetheme.com/apollo13-framework/docs/content-management/shortcodes/gallery/ and in each photo, mark to open in a new window https://rifetheme.com/apollo13-framework/docs/content-management/albums-works-post-types/album-media/.

    Another idea would be to use custom JavaScript plugin like this one https://wordpress.org/plugins/custom-javascript-editor/ and insert such JavaScript(Appearance → Custom JavaScript)
    (function ($) {
    	'use strict';
        $(document).ready(function () {
            $('div.works-columns-1').on('click', 'a', function (e) {
                window.open($(this).attr('href'), '_blank');
                e.preventDefault();
            });
        });
    })(jQuery);
    With kind regards.

  • Posts: 3
    Hello!
    I followed your instruction with JavaScript by adding the provided code to "Simple Custom CSS and JS" plugin but it is only working when we click on the photo's title (text that overlay on top of the each photo). I wonder if are there any codes that, will work on both(title & outside)?

    Thank you
    download.png
    1280 x 799 - 795K
  • AirAir
    Posts: 10,970
    Hey :-)

    I see that currently, you have some JavaScript errors on your website. Not sure where they are coming from. Might be some plugin.

    Anyway, this is prohibiting script to work at all. Try clearing cache and check do you have the same issue.

    With kind regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion