Okay
  Public Ticket #3242389
I would like my blog posts to open in new tabs rather than in same window
Closed

Comments

  •  16
    Jen started the conversation

    When my users visit the news page I would like the actual blog posts to each open in new tabs. How can I do this?

  •  8,839
    Tahir replied

    Hey,

    Please provide the page url so that i can write up the custom code for whats possible.

    Thanks


    ThemeNectar Support Team 

  •  16
  •  8,839
    Tahir replied

    Hey Again,

    Add this to the Custom Code section in the Salient Theme Options Panel -> General Settings.

    <script type='text/javascript'>
    jQuery( document ).ready(function() {
       jQuery('.masonry.material .masonry-blog-item .entire-meta-link').attr('target', '_blank');
    });
    </script>

    Thanks 


    ThemeNectar Support Team 

  •  16
    Jen replied

    I have an alternate page as well but its not working on this layout.. can you tell me if I need a different script for this one?  https://macdochfoundation.org/media/


  •  8,839
    Tahir replied

    Hey Again,

    The Single Images already had an option to adjust the target: 

    4913556448.pngClick on Image to View Larger

    Thanks 


    ThemeNectar Support Team 

  •  16
    Jen replied

    Its the blog widget at the base oof the page.  The top of the page is my stop gap to get this done until I knew how to make it work


  •  16
    Jen replied

    Apologies  Client wanted to make that other page live so I have made a test page to show the blog widgets I want to have open in new windows..

    https://macdochfoundation.org/mediatestpage/


  •  8,839
    Tahir replied

    Hey Again,

    Use this for the other style.

    <script type='text/javascript'>
    jQuery( document ).ready(function() {
       jQuery('jQuery('.post-area.featured_img_left .article-content-wrap .post-featured-img-wrap a, .post-area.featured_img_left .entire-meta-link').attr('target', '_blank');
    });
    </script>

    Thanks 


    ThemeNectar Support Team 

  •  16
    Jen replied

    Thankyou.  This isn't however working :(

    The links are opening but NOT in new tabs.

    https://macdochfoundation.org/mediatestpage/

    Can you take another look for me?

    Client prefers this layout


    Also is there a way with this format for the featured images to be less cropped? as they are chopping off words etc

  •  16
    Jen replied

    If Required I am happy to make new images for these but ideally it would be good if I can make them all the same size etc.. ie squares?

  •  1,877
    Judith replied

    Hi Jen,

    Please try this css to resize the images:

    .post-area.featured_img_left .article-content-wrap .post-featured-img-wrap a span img {
        object-fit: contain;
    }

    Thanks.

  •  16
    Jen replied

    Critical issue is that the links ARE not opening in new tabs.


  •  8,839
    Tahir replied

    The Code added in is not correct. Could you allow us to log in to your website backend dashboard so we can check on this for you more?. We are gonna need the username and password of admin user as well as the login url.

    Thanks 


    ThemeNectar Support Team 

  •  8,839
    Tahir replied

    Here is a revised script. Only add the one below.

    <script type="text/javascript">
    jQuery( document ).ready(function() {
       jQuery('.masonry.material .masonry-blog-item .entire-meta-link,.post-area.featured_img_left .article-content-wrap .post-featured-img-wrap a, .post-area.featured_img_left .entire-meta-link').attr('target', '_blank');
    });
    </script>

    Thanks 


    ThemeNectar Support Team 

  •   Jen replied privately
  •  8,839
    Tahir replied

    Just corrected the script.

    Best 


    ThemeNectar Support Team 

  •  16
    Jen replied

    Thankyou x