- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Tom.
February 10, 2017 at 1:53 pm #277124Dave
I’m using a plugin called VK Link Target Controller that allows post links to open in another page instead of to the target post. I use this for displaying a news feed where some news items open in the post and others open in a PDF. You can see an example on the home page of dev.northwestfiretraining.com
My problem is that there is a box to check in the plugin that allows the individual post to other in a new page or just open in the same window. I have the box checked for the ones opening with PDFs to open in a new box, however they still open in the current window.
I checked the developers page and they show the following for a reason why this might happen:
My link won’t open on a new window.
VK Link Target Controller adds a filter on the the_permalink() WordPress function, which means the redirection won’t work if your theme uses another function, for example get_permalink() to display the links. In order to have the link opened in a new window VK Link Target Controller needs a theme with the post id as id on the
Your theme probably has it if it follows the WordPress Theme recommendations.
<div class="post-item post-block front-page-list">"> <a>"> <?php the_title(); ?> </a> </div>
Is this the case with GeneratePress? And if so, are you aware of a way to make the target work properly?
Thank you so much!
– DaveGeneratePress 1.3.44GP Premium 1.2.94February 10, 2017 at 4:29 pm #277176TomLead DeveloperLead Developer
get_permalink()as it’s inside the
the_title()function and can’t directly call
This is actually the “proper” way to do it, as seen in themes like TwentySeventeen.
They might consider using one of the filters in the
get_permalink()function instead of
the_permalink()as it will make their plugin work with more themes.February 10, 2017 at 6:11 pm #277228Dave
Ok perfect, I’ll see if I can get in touch with the plugin developer. Unfortunately, I have not found any developer as responsive to inquiries as you have been. Thanks again for the help!February 10, 2017 at 8:36 pm #277250
- You must be logged in to reply to this topic.