• I need find a way to make the post excerpt/summary shown on the blog index link to an external site when finding a link in the post content.

    I’ve tried out the Page Links To plugin, which works great for manually updating the permalink of a post… but I need to find a way to make this happen automatically, by finding the URL from the post content and using it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kevintucker

    (@kevintucker)

    Anybody have an idea? Sorry to post just to bump… but I can’t find another solution, and hoping someone has found a need to solve this problem and knows of a ready-made solution somewhere that I’m simply missing. Thanks!!

    Hi

    I used this, which makes the featured image a link to the external, though it doesn’t work on some sites I have tried it on, (with same theme), could be a plugin conflict. Really slowed down one site I tried this on though.

    <?php $mypostimage = ''; if ( has_post_thumbnail() ) {
    $mypostimage = get_the_post_thumbnail($page->ID, 'summary-image', array('class' => 'photo' , 'alt' => get_the_title() , 'title' => get_the_title() ));
    } ?>
    <div class="storycontent"><?php echo apply_filters('the_content', preg_replace('/<img ([^>]*)>/', $mypostimage, get_the_content())); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Automatically changing the permalink address to external link?’ is closed to new replies.