Feedzy - link the read more button of imported posts to the original article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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