Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    thanks again for 5-star review. We’re not perfect, but we’re trying. ??

    If you want your related posts to open in a new window/tab, open wp_related_posts.php in plugin editor and find two lines of code (line 290 and 299) listed below. You’ll have to add target attribute to the links being generated.

    Here’s line #290:

    $output .=  '<a href="' . $post_url . '" class="wp_rp_thumbnail">' . $img . '</a>';

    … replace it with (note the target attribute):

    $output .=  '<a href="' . $post_url . '" class="wp_rp_thumbnail" target="_blank">' . $img . '</a>';

    and line #299:

    $output .= '<a href="' . $post_url . '" class="wp_rp_title">' . wptexturize($related_post->post_title) . '</a>';

    … replace it with:

    $output .= '<a href="' . $post_url . '" class="wp_rp_title" target="_blank">' . wptexturize($related_post->post_title) . '</a>';

    Hope this helps. If you have any other question or need further assistance, we’ll gladly help.

    Take care & have a nice day,
    Mateja

    Thread Starter Shwepps

    (@shwepps)

    Yeah, this helps! Thanks a lot, again.

    Good luck!:)

    One more thing… next time you upgrade the plugin, these changes might be lost and you’ll have apply them again. But… We’ll cross that bridge when we get there ??

    Happy blogging!

    Thread Starter Shwepps

    (@shwepps)

    That’s not a problem, I usually never upgrade plugins and wp once it’s installed) But thanks for notice, anyway!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to open related posts in new tab?’ is closed to new replies.