• I wonder which files to modify inside Tempera theme to make each link (posts, categories etc) to open in new tab instead of opening in the same tab.
    I did some search and found that I should use the target=”_blank” but it didn’t work for me although I tried to add it in several php files inside the theme.

    Any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey,

    Pretty straight forward solution is to edit the template file that is used to display blog posts. Since your using Tempera I believe the file that is used in the blog view is content.php which can be found in:
    /wp-content/themes/tempera/content/content.php

    Then on line 21 (This can change depending on version) look for something like:

    <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr ( __( 'Permalink to %s', 'tempera' ) ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>

    Change it to:

    <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr ( __( 'Permalink to %s', 'tempera' ) ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" target="_blank"><?php the_title(); ?></a>

    Thread Starter eliassouliotis

    (@eliassouliotis)

    Hello Simon,

    Thank you for replying.
    Already tried this with no luck.
    Also tried many other php files in same folder (content) but it didn’t work either.

    Sounds like you need to scan all the files in your theme directory then for what’s causing it. Something is adding it, its not a core feature of WordPress. Also, try disabling plugins one by one, also be aware that your host can cache HTML, for example Gandi uses vanish which is a cache proxy, changing the HTML doesn’t do anything until the cache expires, so bare that in mind and do ensure that your HTML is absolutely not cached.

    Thread Starter eliassouliotis

    (@eliassouliotis)

    Done that with no luck. You are right about the cache, tried that too.
    I am not sure about plugins, i think it is more general, plus, I need them!

    Anyway, thank you for your post.

    Need them or not they are most likely causing a problem. You should disable one by one, and find out which one could be doing it. Only then will you be able to find out what is causing it, then possibly use alternatives.

    Additionally just to point out Google does in fact index pages with “nofollow” and is not to be confused with “noindex”. What nofollow does it stops Google discovering pages past that page. So if the nofollow page is in your sitemap then it should be indexed, use site: example.com/page-to-test on Google.

    Thread Starter eliassouliotis

    (@eliassouliotis)

    Ok I’ll try disabling the plugins then ??

    Did you manage to narrow it down? what was causing it?

    Thread Starter eliassouliotis

    (@eliassouliotis)

    Hi Simon,

    Sorry for my late reply.

    I finally had to edit the plugins to achieve it. Disabling every plugin did not solve the problem. I have Special Recent Posts plugin in my homepage which has this option and Royal Slider which as an editing window in the settings.

    I also change a setting in the Menus where this option is available.

    All it’s left is to find the proper php file for single posts. When I have time I will try to edit the corresponding files such as single.php and let you know how it went.

    Thank you for your concern.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘how to open each post in new tab’ is closed to new replies.