WordPress.org

Ready to get started?Download WordPress

Forums

Open in new window (5 posts)

  1. erickeel
    Member
    Posted 1 year ago #

    Where in the following code, do I add the target="_blank" to make my images open in another window?

    <a href="?php $key="featured_external"; echo get_post_meta($post->ID, $key, true); ?>" title="<?php the_title(); ?>">
    						<?php
    						if(has_post_thumbnail())
    							the_post_thumbnail('thumbnail');
    
    						if($category[0]->slug == 'projects'){ ?>
    						<span>
    							<strong><?php echo get_the_title() ?></strong>
    							<?php echo get_the_excerpt() ?>
    						</span>
    						<?php } else { ?>
    						<span>on <?php echo $category[0]->cat_name?></span>
    						<?php } ?>
    					</a>
  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Where in the following code, do I add the target="_blank" to make my images open in another window?

    Even if you do, all modern browsers allow users( often with default settings) to open in a new Tab (not window) as a new window opens a new local browser session...

    That said, it's not directly in that code but in the post thumbnail function...typically found in functions.php...

    the_post_thumbnail( $size, $attr );
    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

  3. David Choi
    Member
    Posted 1 year ago #

    It can be

    <a target="_blank" href

  4. erickeel
    Member
    Posted 1 year ago #

    You are a genius. Thank you.

  5. David Choi
    Member
    Posted 1 year ago #

    Glad it was helpful, have a nice day!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.