Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefan-cotitosu/126f7a7879ee798cef86d8d45131cb93 to your computer and use it in GitHub Desktop.
Save stefan-cotitosu/126f7a7879ee798cef86d8d45131cb93 to your computer and use it in GitHub Desktop.
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