Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Feedzy - link the read more button of imported posts to the original article
<?php
/**
* Plugin Name: Feedzy posts - link the read more button to the original article
* Description: Link the read more button of posts imported by Feedzy to the original article
* Version: 1.0
* Author: Themeisle
* Author URI: https://themeisle.com
*/
function new_excerpt_more($more) {
$current_post_id = get_the_ID();
$current_post_meta = get_post_meta($current_post_id);
if (isset($current_post_meta['feedzy_item_url'][0])) {
return ' <a href="' . $current_post_meta['feedzy_item_url'][0] . '">Read More</a>';
}
return $more;
}
add_filter('excerpt_more', 'new_excerpt_more');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment