We're merging with GenerateBlocks! Learn more here.

[Support request] How to open link in new tab the list of post?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support How to open link in new tab the list of post?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #15203
    Maria Rowena
    Participant

    Good morning, I am wondering if it’s possible for the list of post to open link in new tab? I am really newbie in WordPress. Hope you can help me. Thanks a lot. 🙂

    #15219
    Tom
    Keymaster

    Hi there,

    As of right now you would need javascript to do this, unfortunately.

    Something like this:

    <script>
        jQuery( document ).ready( function( $ ) {
            $('.wp-show-posts-entry-title a').attr('target','_blank');
        } );
    </script>
    #15238
    Maria Rowena
    Participant

    I’m sorry Tom, I’m not good at using coding script. Where should I place this? I also use premium GeneratePress theme can I use the hook element there?

    #15280
    Tom
    Keymaster

    Since you’re using GP Premium, you can add a Hook Element add the code to the wp_footer hook 🙂

    #15515
    Maria Rowena
    Participant

    Thank you much Tom! This works well! More power to you and to your team!

    #15545
    Tom
    Keymaster

    Glad I could help 🙂

    #21938
    Linda
    Participant

    How about doing the same thing on the “read more” button? I’ve got it working on the title, but would like the same behavior on the read more.

    #21997
    Tom
    Keymaster

    You would do this:

    <script>
        jQuery( document ).ready( function( $ ) {
            $('.wp-show-posts-read-more').attr('target','_blank');
        } );
    </script>
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.