detonate
detonate

Reputation: 289

Simple target="_blank"

I'm having a really hard time simply trying to include a target="_blank" in this PHP condition. Could someone please help me out?

if (!empty($options['help_uid'])) echo '<li class="help-icon">
   <a href="' . $options['help_uid'] . '">'
. '<img src="' . get_stylesheet_directory_uri()
. '/icons/help-icon.png" width="24" height="24" alt="Help">'
. '</a></li>';

Upvotes: 0

Views: 238

Answers (2)

cartina
cartina

Reputation: 1419

You can try this

if (!empty($options['help_uid'])) { ?>
<li class="help-icon">
   <a href="<?php echo  $options['help_uid']; ?>" target="_blank">
<img src=" <?php echo get_stylesheet_directory_uri(); ?>/icons/help-icon.png" width="24" height="24" alt="Help"/>
</a>
</li>

Upvotes: 1

user1645055
user1645055

Reputation:

you should use like this

if (!empty($options['help_uid'])) echo '<li class="help-icon">
   <a href="' . $options['help_uid'] . '" target="_blank">'
. '<img src="' . get_stylesheet_directory_uri()
. '/icons/help-icon.png" width="24" height="24" alt="Help">'
. '</a></li>';

Upvotes: 0

Related Questions