• How can I link the title of a post to an external site while keeping the publishing date linked to the internal post like normal?

    I’ve tried a few options but haven’t been able to get exactly what I need:

    The Page Links To plugin creates the external link for me, but then both the title and post date link to the external site.

    The code shown here (https://wordpress.stackexchange.com/questions/64285/change-post-permalink-to-external-url-from-custom-field) seems to let me add an external link, but I can’t figure out how to get that linked up to the post title.

    (I’m not sure it matters, but just in case, I’m starting with WP’s Twenty Fourteen theme. I don’t mind messing with code at all, but my programming knowledge is rudimentary at best and I haven’t been able to wrap my head around what exactly is going on and what I need to do to get this done.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can use Redirection plugin and Redirect the title link to Externel Link.

    Create a custom field with the external link then edit your theme for the title to link according to the custom field.

    <h1>
    <?php if( get_post_meta($post->ID, "CUSTOM-FIELD-HERE", true) ): ?>
    <a href="<?php get_post_meta($post->ID, "CUSTOM-FIELD-HERE", true) ); ?>">
    <?php the_title(); ?>
    </a>
    </h1>
    <?php else: ?>
    <h1>
    <?php the_title(); ?>
    </h1>
    <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘link post title to external site’ is closed to new replies.