• Is there any way to enable every posts in my website to be opened in a new tab? As i have only managed to change menu items to be opened in new tab. i would like to do so for all my portfolio posts as well. Thanks

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

    Add target=”_blank” to the link in your template file preferably in your child theme, so it looks like this
    ” target=”_blank”>

    Thread Starter Cluelessguy

    (@cluelessguy)

    Hi codemovement,

    Im not sure how to go about doing that. But will it be able to make essentially everything i click to open in a new tab?

    if your theme adds class to body, you should have post class “single-post” then in simply add in your One of the JS or in header file.

    <script type=”text/javascript”>
    $(“.single-post a”).attr(“target”,”_blank”);
    </script>

    if your theme doesn’t add class to body, add this:

    <body <?php body_class($class); ?>>

    Thread Starter Cluelessguy

    (@cluelessguy)

    Hi Ahir,

    do you mind providing a more step by step guide on doing it. As i have very little knowledge in wordpress. Thanks for your help

    Ok so you have list of post in template file right ? Then simply add ” target=”_blank” ,in that file, post your code here So we can check

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Opening posts in New tab’ is closed to new replies.