Support » Theme: Atomic Blocks » Open links in new window (AB Post and Page Grid)

  • Resolved zeekhoe

    (@zeekhoe)


    Hi,

    I have a Latest Posts Grid on my homepage. I would like to be able to open the links in this list in a new window.

    I had achieved this by editing wp-includes/blocks/latest-post.php

    I changed a href=”%1$s” to a href=”%1$s” target=”_blank”

    This worked fine, but after an update the default latest-post.php was reset. I made the edits again, but now they no longer work.

    Can you tell me what I need to do to make it work again, so links open in a new window?

    Please note: if you look at the website, currently the links do open in a new window, but that’s because I added <base target=”_blank” /> to the overall header. This causes ALL the links on the website to open in a new window (e.g. menu’s, etc.). That’s not what I want to achieve, I only want the links in the AB Post and Page Grid to open in a new window.
    Thanks!

    • This topic was modified 1 month, 3 weeks ago by zeekhoe.
    • This topic was modified 1 month, 3 weeks ago by zeekhoe.
    • This topic was modified 1 month, 3 weeks ago by zeekhoe.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Okay, my bad, I found that I edited the wrong .php file. For others struggling with the same problem: the file you need to edit is /wp-content/plugins/atomic-blocks/src/blocks/block-post-grid/index.php. Add target=”_blank” after “a href=”%1$s” in the block-post-grid-image (line 87), block-post-grid-title (line 118) and grid-more-link ab-text-link (line 204).
    That fixes it and the links open in a new window.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.