WP post open in new window

6 replies
Hi all, been looking all over for a plugin that will open my wordpress post's in a new window.

Can anyone advise me as to a plugin or a EASY code and where to place it to open my post on new pages.

thanks Auggie :confused:
#open #post #window
  • Profile picture of the author jjpmarketing
    If you edit your "index.php" file in the wp admin panel you can add:

    Code:
    target="_blank"
    to your post title.

    Should be a line similar to this under "div class=post-title".

    Code:
    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" target="_blank" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    Notice where I have already added it here, just before the "title" section.

    Hope that helps.

    Dennis
    {{ DiscussionBoard.errors[793108].message }}
  • Profile picture of the author turnkeybiz
    Thank Dennis for your help, I tired what you said and it didn't work. Some more information on why

    1. I am using a page as my main index so no post are showing there.

    2. The post show in the category archive.php page. I edited this already just to show the heading of the post with no comments.

    3. I have a redirect plugin that I want to use to redirect post to an affiliate link outside of my site.

    This is why I would like the post to open to a new page.

    Here is the code that looks like what you wanted me to edit on my index page that I pulled from my archive page

    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

    again thanks for any help

    Auggie
    Signature
    "A man's worth, is not measured by the numbers in his bank account, but in the number of people that call him friend" Internet Marketing Consultant - Ask8.com
    {{ DiscussionBoard.errors[793176].message }}
    • Profile picture of the author YiKeS
      G`day Auggie,

      check your code Dennis ... I
      think your fingers stuttered ...

      <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>"
      rel="bookmark" target="_blank" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
      Try this ...

      <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" rel="bookmark" target="_blank"><?php the_title(); ?></a></h3>
      If it still throws an error try using single quotes
      around bookmark and _blank ... that may help

      **I make no claim that this will work**


      YiKeS
      Signature
      AUSSIE MADE
      WSO --> HOMEPAGER <--- WSO
      {{ DiscussionBoard.errors[793300].message }}
      • Profile picture of the author jjpmarketing
        No my code was correct. It was copy and pasted.

        She had a different setup that is why it didn't work. She had a list of categories that was being clicked and to change that, I had to modify the archive.php file instead of the index.php file.

        Dennis
        {{ DiscussionBoard.errors[793317].message }}
        • Profile picture of the author YiKeS
          Originally Posted by jjpmarketing View Post

          No my code was correct. It was copy and pasted.

          She had a different setup that is why it didn't work. She had a list of categories that was being clicked and to change that, I had to modify the archive.php file instead of the index.php file.

          Dennis
          Oh yeah .. I see now you even say it`s the index file to

          Guess my eyes stuttered LOL

          YiKeS
          Signature
          AUSSIE MADE
          WSO --> HOMEPAGER <--- WSO
          {{ DiscussionBoard.errors[793358].message }}
          • Profile picture of the author jjpmarketing
            No harm, no foul. Need an eye doctor referral? LOL
            {{ DiscussionBoard.errors[793371].message }}

Trending Topics