• Resolved ocbroadband

    (@ocbroadband)


    Hello,

    Curious if the option can be added to the ‘General settings’ page to provide a target for the ‘Link to source’ option. It currently loads in the same window and it would be better to load in a new tab/window so the existing website is not exited.

    Great plugin!

    Thanks..

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor cyberseo

    (@cyberseo)

    CyberSyn does not display the post content, permalinks etc. The permalink URL attributes (title, rel. target etc) are defined if your WordPress theme. Thus you should search the theme files for the_permalink. Usually but not always it’s located in template-tags.php. For example, in standard TwentySixteen theme the related part of code looks like this:

    <a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
        <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
    </a>

    You should alter it the following way:

    <a class="post-thumbnail" href="<?php the_permalink(); ?>" target="_blank" aria-hidden="true">
        <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
    </a>

    Now all post permalinks will be opened in a new window (note target=”_blank”).

    Thread Starter ocbroadband

    (@ocbroadband)

    Hi,

    Thanks for the reply. I’m not a coder so to speak, but wouldn’t that would change it for the entire site? That’s not what I want to do, just for the posts that are syndicated.

    If I am misunderstanding, please advise. In the syndication I have, I understand that it downloads the entire post and creates a local copy, but creates redirects back to the originating site. And the option in the settings just redirects back to the originating post vs. the local copy. Great.

    The end goal is to have anything that is ‘syndicated only’ to show the excerpt that I’ve defined, and any links, redirect to the original site/post, and it open in a new window. Is this possible? Or is the above the method to do that just for the syndicated posts.

    Thanks for the guidance.

    Plugin Contributor cyberseo

    (@cyberseo)

    This code will do the trick:

    <a class="post-thumbnail" href="<?php the_permalink(); ?>" <?php if (strlen(get_post_meta(get_the_ID(), 'cyberseo_rss_source', true))) {echo 'target="_blank"';} ?> aria-hidden="true">
        <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => the_title_attribute( 'echo=0' ) ) ); ?>
    </a>
    Thread Starter ocbroadband

    (@ocbroadband)

    This goes in the location you indicated in the 1st reply? If so, I’ll give it a try. Aside from this, possible to make this a option in a future release vs. editing code?

    Thanks again for the guidance.

    Plugin Contributor cyberseo

    (@cyberseo)

    Once again. This can not be done via CyberSyn, because it’s hard coded in your theme. Only it (your theme) decides how exactly the post links should be displayed on your index page (the link color, the font size, the destination window etc). If you want to change it – alter the theme.

    • This reply was modified 6 years, 3 months ago by cyberseo.
    • This reply was modified 6 years, 3 months ago by cyberseo.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘New window for topics’ is closed to new replies.