Open blog posts in a new window

Posted in: Newspaper
Post count: 10

Hello,

I was wondering if you could help me to set the theme so it will open all blog posts in a new window/tab? that is, when a user opens a post/article on my website, it opens in a new window. Or if you know of a plugin that does that?

Now, I know some argue this is not a good practice as it should be up to the users to control this, I am not here to argue, I want this for my users because of how I am going to be using the theme, otherwise, the theme of the website will be useless, the website will not work or at least, it will be hell of a lot more inconvenient for the user. Can you please help implementing this?

Regards,
Valli

Post count: 10

Maybe this could be solved with javascript?

Post count: 22421

Hello,

You will have to modify the theme function to open all theme links in a new window. Here is the default function to get post links: https://www.screencast.com/t/ha4wWgM2c2o You will have to add a target_blank property to it: https://www.w3schools.com/tags/att_a_target.asp

Thank you!

Post count: 10

Thank you, but I am no programmer and I have no idea where to insert the target=”_blank”? That is, in the picture, you pointed at generally at a code and I don´t know where to place the target=”_blank” in that section.

Another thing, won´t this just change every time you update the theme? Could you maybe include this as a feature in your next update, as a tick box or something?

  • This reply was modified 8 years by Valli.
Post count: 20688

Hi,

The link property would have to be set like this to affect the module titles
https://www.screencast.com/t/NUsgn5MZ
https://www.screencast.com/t/7CpFQGNzCue
However the modification would have to be made again after updating the theme. I could not say if this will be an option in the theme in the future. It might be at some point.

Thanks

Post count: 10

Hi,

Thank you for the reply. I already tried that, it didn´t work, nothing changed, the blog posts still open in the same tab (on my website), is there anything else that might have to be done?

Post count: 10

I know that catch plugins might interfere but I don´t have any such plugins on my website.

So this is what I did;

function get_title($cut_at = ”) {
$buffy = ”;
$buffy .= ‘<h3 class=”entry-title td-module-title”>’;
$buffy .=’href . ‘” rel=”bookmark” title=”‘ . $this->title_attribute . ‘” target=”_blank”>’;

Post count: 20688

Hi,

Please provide a link to your website so we can inspect it. That modification should affect the post titles and open the links in a new tab.

Thanks

Post count: 10

Hi,

The website is locked with a password, so I would need to send you a user and password, what e-mail can I send it too?

Thank you!

Post count: 20688

Hi,

Send the login details to contact@tagdiv.com and also FTP login information. We will try to give you a solution in this matter. Also paste a link to this topic in the email.

Thanks

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.