Titles Of Posts Not Linking To Source Websites

Hello, I have activated the add-on to the plugin. Canonical link in header is not working, it's still going to a post entry on my own site instead of going to the source site an example is;

Go to site - http://okconference.org/

Under O-K GREEN HEADLINES, the first article to the left. http://okconference.org/2016/08/26/zeeland-west-high-school-varsity-football-beat-cedar-springs-high-school-14-9/ It's just going to a post on my site as I had mentioned and not linking to the source of http://zeelandwestsports.com/2016/08/26/zeeland-west-high-school-varsity-football-beat-cedar-springs-high-school-14-9/

Thanks for your help on this!

  • Adam Czajczyk

    Hello Matthew,

    I hope you're well today and thank you for your question!

    The "Canonical link in header" add-on is not meant to make post title point to an original article. It's there to create a rel="canonical" link in posts header (as in single post page HTML source). I checked your site and it's working fine, see below:

    Take a look at this Wikipedia article please to find out more about canonical links and their meaning for site performance in search results:

    https://en.wikipedia.org/wiki/Canonical_link_element

    You may want to use an "Use External Permalinks" add-on instead. It's designed to allow you to replace default WP post permalinks with links to an original URL taken from a feed.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Matthew!

    I'm glad I could help.

    The "open link in new tab" option however doesn't depend on plugin settings but on the theme that you are using. By default most themes open links in the same window so an option here would be to create custom page templates changing the way post titles are displayed and adding "target=_blank" attribute to "a" tags for the title.

    There may be other solution as well though. Should this affect all articles anywhere on your site or just selected articles and/or on selected pages/sections of your site? Give me please as much details about those articles (their locations mostly) that you'd wish to be affected by this and I'll check your site too see if I'd be able to provide you with an alternative solution.

    Best regards,
    Adam

  • Matthew

    Since 95% of the posts (not pages) need to be opened in a separate tab, I could go with something that opens all posts in a new tab. There's only like one or 2 posts a week that will be originated from the site itself, the rest are coming from the schools (sites) that are members of this conference (the site we are talking about).

    So the slider posts here - http://okconference.org/ are created natively. Everything else (just about) is pulled in via RSS.

  • Adam Czajczyk

    Hello Matthew,

    Thank you for your replay!

    It seems that I found even better solution. The code below should cause all external links to be opened in new tabs but keep internal ones in the same tab. As a result, when you click on a title of any "locally posted" post or page, a menu link or any other link that's withing your site's domain such a link should be loaded into the same tab. External links however, such as links coming from feeds, should open in a new tab. Give it a try please:

    <?php 
    
    function wpmu_open_post_links_in_new_tabs() {
    ?>
     <script type="text/javascript">
            jQuery(document).ready(function($) {
                $('a[href^="http://"], a[href^="https://"]').not('a[href*=okconference]').attr('target','_blank');
            });
        </script>
    <?php
    }
    
    add_action('wp_footer','wpmu_open_post_links_in_new_tabs',99);

    In order to apply this code to your site add it as an MU ("Must Use" plugin) as follows:

    - create an empty file with a ".php" extension (e.g. "open_links_in_new_tabs.php")
    - copy entire code and paste it there
    - upload the file to the "/wp-content/mu-plugins" folder on your server

    If there's no "mu-plugins" folder inside the "wp-content" folder please create it.

    Let me know please if that works for you.

    Best regards,
    Adam