• Resolved deterius

    (@deterius)


    I’ve seen this asked many times but never answered, and I’ve searched quite a bit.
    Whats a good way to have all posts open in a new window?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • add target="_blank" to the link html code of the linked post titles in index.php(?) and archive.php … (where ever a list of posts with a linked post title appears)

    https://www.w3schools.com/tags/att_a_target.asp

    example (of twenty ten in loop.php) changed to open in new window:

    <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" target="_blank"><?php the_title(); ?></a></h2>
    Thread Starter deterius

    (@deterius)

    Sweet!
    Thats the more difficult part is to find out where the post links are being generated. Thats the issue- will they all be in the loop?

    that will depend on the theme you are using;

    mostly the links are in the pages which show multiple posts, such as index.php, home.php, archive.php, category.php, search.php, tag.php …

    in some themes these templates might be calling loop.php where you may find the link;
    other theme might have this in some functions…

    Thread Starter deterius

    (@deterius)

    Great- good point!
    I will go a hunt for it! Thanks a lot.

    Thread Starter deterius

    (@deterius)

    For anyone searching this topic:
    I’ve searched for the code alchymyth posted, and several variations in other plug-ins and I found it. I cant find it in all plug-ins but I’m still looking.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Open Post in new window?’ is closed to new replies.