• dshayne

    (@dshayne)


    Hi,
    I would like the read more tag to open the whole post in a blank window (target=”_blank). How dod I do this globally for my site?
    Thanks in advance,
    Debbie

Viewing 8 replies - 1 through 8 (of 8 total)
  • Rajan Vijayan

    (@rajanit2000)

    Yes its possible with jQuery

    May i know your theme name and link

    Thread Starter dshayne

    (@dshayne)

    Thanks! It is Pressplay and the link is https://www.plumpub.com/kaimen

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    are you using the “read more” tag on an excerpt or based on <!--more-->?

    There are filters that will let you modify these rather than relying on jQuery.

    Thread Starter dshayne

    (@dshayne)

    Hi Steve,
    Yes, just using the regular old read more tag…Thanks!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    what does that mean? How are you getting a read more tag?

    are you using the_excerpt() or inserting <!–more–> in your content or manually adding a link?

    Thread Starter dshayne

    (@dshayne)

    Sorry. I am inserting <!–more–> in the content.
    Debbie

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Add something like this to your theme’s functions.php file

    function modify_read_more_link() {
        return '<a class="more-link" href="' . get_permalink() . '" target=_blank>Your Read More Link Text</a>';
    }
    add_filter( 'the_content_more_link', 'modify_read_more_link' );

    see https://codex.www.ads-software.com/Customizing_the_Read_More

    If you are not working in a child theme, it might be a good idea to create one first.

    Thread Starter dshayne

    (@dshayne)

    Thank you so much. I will try it and let you know.
    Debbie

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Read More Tag Opens in New Window’ is closed to new replies.