We're merging with GenerateBlocks! Learn more here.

[Resolved] Title link to new window

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Title link to new window

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36437
    Hans
    Participant

    I want to change the title link in a specific wpsp list to _blank target windows. Is there a solutuon?

    #36446
    elvin
    Moderator

    Hi Hans,

    The link is hard-coded, unfortunately.
    https://github.com/tomusborne/wp-show-posts/blob/35e410d7800273fc66f211c0f80d553e95d17f83/wp-show-posts.php#L439

    Consider adding it using a javascript.

    Something like:

    var title_link = document.querySelectorAll('.wp-show-posts-entry-title > a');
      for (var i=0; i<title_link.length; i++){
            title_link[i].setAttribute('target', '_blank');
      }

    Hook this on your site’s wp_footer.

    #36456
    Hans
    Participant

    Thank you! It works!!!

    #36464
    elvin
    Moderator

    No problem. 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.