Changing Link To Open In Same tab

I have zero programming knowledge, just enough to make the necessary modification with the proper coding of course. It’s the coding I can’t fix. I’m trying to change a portfolio plugin from generating a new window on link click to generating in the same tab. Below is, what I’m pretty sure is, the necessary php sheet:

<?php
/*-----------------------------------------------------------------------------------*/
/*	Post type: Link
/*-----------------------------------------------------------------------------------*/
//get portfolio_settings options in serialized format...
$portfolio_settings = get_option('portfolio_settings');

$data_results = unserialize($portfolio_settings); //unserialize the $video_settings array..
$portfolio_link_target = $data_results['portfolio_link_target'];
if(empty($portfolio_link_target))
{
	$portfolio_link_target='popup';
}
$portfolio_link_title = get_post_meta(get_the_ID(),'portfolio_link_title', true );
$portfolio_link_url = get_post_meta(get_the_ID(),'portfolio_link_url', true );
global $count;
						// Get The Taxonomy 'Filter' Categories
						$terms = get_the_terms( get_the_ID(), 'portfolio-categories' );
					?>
							<?php
								//Apply a data-id for unique indentity,
								//and loop through the taxonomy and assign the terms to the portfolio item to a data-type,
								// which will be referenced when writing our Quicksand Script
							?>
							<li data-id="id-<?php echo $count; ?>" data-type="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\\s+/', '-', $term->name)). ' '; } ?>">
								
										<?php // Output the featured image ?>
										<a href="<?php echo $portfolio_link_url ?>">
										<h1><?php echo $portfolio_link_title;?></h1>
										
                                        </a>									
										<?php the_content();?>									
										
									<?php // Output the title of each portfolio item ?>
									<p><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></p>
									
							</li>

I’m no PHP expert, nor do I know if this will help, but…

$portfolio_link_target = $data_results['portfolio_link_target'];
if(empty($portfolio_link_target))
{
	$portfolio_link_target='popup';
}

Is saying that the variable $portfolio_link_target is equal to the data (option) set in the plugin’s settings, if that option is empty (not set), than set the portfolio_link_target to “popup”.

So, I would check the plugins settings for an option to set the link target manually. :slight_smile:

I think @RetroNetro; is on the right track.
There is not enough information here to provide more than a guess. But I suspect this will give you the behavior you want:


if(empty($portfolio_link_target))
{
	$portfolio_link_target='_blank';
}

In HTML, for any link there is an attribute called “target”. If that is set to ‘_blank’ the linked content will open in a new window.
It appears that is being set by the $portfolio_link_target PHP variable.

Ok, so I’m a bit familiar with HTML and CSS, but when it comes to any other languages, I’m a terd. I went ahead and tried what you suggested, but to no avail. I noticed the php to be somewhat of a revised version of HTML? In any case, I still didn’t know the proper coding so refrained from any attempts.

So, any other suggestions? The portfolio plugin I’m using is called Rio Portfolio. There is no option that I can see that allows me to choose how the portfolio is opened from within the plugin.

It is right here on this page (2nd screenshot): http://wordpress.org/plugins/rio-portfolio/screenshots/ There is a setting to open links in popup or hyperlink. Select the Hyperlink option. :slight_smile: