Shop Categories

X

Open link in new window – front page box

Home Forums Agama Pro Open link in new window – front page box

Topic Resolution: Resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2379
    Richelle
    Participant

    Hello. I would like to have the “read more” button open a new window, not replace the current one. How can I access the code to do that? Thank you.

    #2399
    Jerry
    Keymaster

    Hello Richelle,

    You must add new function to your Agama Pro child theme in functions.php file:

    function add_blank_to_link($link) {
    $pos = strpos($link, 'a href');
    if ($pos) {
    $link = substr_replace($link, 'a target="_blank" href', $pos, 6);
    }
    return $link;
    }
    add_filter('the_content_more_link', 'add_blank_to_link');

    Best Regards

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