MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

Have Promo Boxes open in a new browser tab

Please note: This article is specifically for the Oleander, Laurel, and Redwood themes. 


REDWOOD THEME

To have your 3 Promo Boxes open in a new browser tab, we can add a little bit of code to their HTML code element. In order to access the necessary theme file, you will need to do so via FTP or via a code editor plugin such as WPide (http://wordpress.org/plugins/wpide). We recommend WPide for its ease. 

Once you've installed and activated WPide, you can navigate to WP Dashboard > WPide > themes > redwood > "inc" folder > "promo" folder > and open up the file titled "promo.php". 

In this document, there are 3 sections of code. Each section controls one of the 3 promo boxes. We'll need to make a code adjustment to each of these 3 sections to have them open in a new browser tab. 

On Line 5, you'll see this line of code:

<?php if(get_theme_mod('sp_promo1_url')) : ?><a href="<?php echo get_theme_mod('sp_promo1_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('sp_promo1_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo1_url'); ?>" class="promo-link"></a><?php endif; ?>


Next, on Line 16, you'll see this line of code:

<?php if(get_theme_mod('sp_promo2_url')) : ?><a href="<?php echo get_theme_mod('sp_promo2_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that with the following code instead: 

<?php if(get_theme_mod('sp_promo2_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo2_url'); ?>" class="promo-link"></a><?php endif; ?>


Lastly, on Line 27, you'll see this line of code for the 3rd Promo Box:

<?php if(get_theme_mod('sp_promo3_url')) : ?><a href="<?php echo get_theme_mod('sp_promo3_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('sp_promo3_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo3_url'); ?>" class="promo-link"></a><?php endif; ?>


Save changes to the file when finished. 

If you have a cache tool operating on your WordPress and/or browser, it's recommended you clear the cache afterward. 




OLEANDER THEME 

To have your 3 Promo Boxes open in a new browser tab, we can add a little bit of code to their HTML code element. In order to access the necessary theme file, you will need to do so via FTP or via a code editor plugin such as WPide (http://wordpress.org/plugins/wpide). We recommend WPide for its ease. 

Once you've installed and activated WPide, you can navigate to WP Dashboard > WPide > themes > oleander > "inc" folder > "promo" folder > and open up the file titled "promo.php". 

In this document, there are 3 sections of code. Each section controls one of the 3 promo boxes. We'll need to make a code adjustment to each of these 3 sections to have them open in a new browser tab. 

On Line 7, you'll see this line of code:

<?php if(get_theme_mod('sp_promo1_url')) : ?><a href="<?php echo get_theme_mod('sp_promo1_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('sp_promo1_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo1_url'); ?>" class="promo-link"></a><?php endif; ?>


Next, on Line 26, you'll see this line of code:

<?php if(get_theme_mod('sp_promo2_url')) : ?><a href="<?php echo get_theme_mod('sp_promo2_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that with the following code instead: 

<?php if(get_theme_mod('sp_promo2_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo2_url'); ?>" class="promo-link"></a><?php endif; ?>


Lastly, on Line 45, you'll see this line of code for the 3rd Promo Box:

<?php if(get_theme_mod('sp_promo3_url')) : ?><a href="<?php echo get_theme_mod('sp_promo3_url'); ?>" class="promo-link"></a><?php endif; ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('sp_promo3_url')) : ?><a target="_blank" href="<?php echo get_theme_mod('sp_promo3_url'); ?>" class="promo-link"></a><?php endif; ?>


Save changes to the file when finished. 

If you have a cache tool operating on your WordPress and/or browser, it's recommended you clear the cache afterward. 




LAUREL THEME 

To have your 3 Promo Boxes open in a new browser tab, we can add a little bit of code to their HTML code element. In order to access the necessary theme file, you will need to do so via FTP or via a code editor plugin such as WPide (http://wordpress.org/plugins/wpide). We recommend WPide for its ease. 

Once you've installed and activated WPide, you can navigate to 
WP Dashboard > WPide > themes > oleander > "inc" folder > "promo" folder > and open up the file titled "promo.php". 

In this document, there are 3 sections of code. Each section controls one of the 3 promo boxes. We'll need to make a code adjustment to each of these 3 sections to have them open in a new browser tab. 

On Line 12, you'll see this line of code:

<?php if(get_theme_mod('laurel_promo1_url')) : ?><a href="<?php echo esc_url(get_theme_mod('laurel_promo1_url')); ?>" class="promo-link"></a><?php endif; ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('laurel_promo1_url')) : ?><a target="_blank" href="<?php echo esc_url(get_theme_mod('laurel_promo1_url')); ?>" class="promo-link"></a><?php endif; ?>


Next, on Line 25 or 26, you'll see this line of code:

<?php if(get_theme_mod('laurel_promo2_url')) : ?><a href="<?php echo esc_url(get_theme_mod('laurel_promo2_url')); ?>" class="promo-link"></a><?php endif; ?-->

You can replace that with the following code instead: 

<?php if(get_theme_mod('laurel_promo2_url')) : ?><a target="_blank" href="<?php echo esc_url(get_theme_mod('laurel_promo2_url')); ?>" class="promo-link"></a><?php endif; ?>


Lastly, on Line 38 or 39, you'll see this line of code for the 3rd Promo Box:

<?php if(get_theme_mod('laurel_promo3_url')) : ?><a href="<?php echo esc_url(get_theme_mod('laurel_promo3_url')); ?>" class="promo-link"></a><?php endif; ?>


You can replace that line of code with the following code instead:

<?php if(get_theme_mod('laurel_promo3_url')) : ?><a target="_blank" href="<?php echo esc_url(get_theme_mod('laurel_promo3_url')); ?>" class="promo-link"></a><?php endif; ?>


Save changes to the file when finished. 

If you have a cache tool operating on your WordPress and/or browser, it's recommended you clear the cache afterward.