Hi, so i'm working with the News Manager plugin, and I guess it's no longer supported, which is fine, but I'm having a problem with getting the URL to work for a 'Read More' button I've added. Currently, in the News Manager plugin, if you have an excerpt, it just adds '[...]' to the end of the post. It's not a link or anything. I know you can access the full post by clicking on the title, but not everyone will think that way. I've tried incorporating PHP in a number of different ways to get the URL working to bring the button to the full post, but none of them are working. On other pages, I would use to get the URL. It does not work in this instance. Here is what I have:
It's on the 'functions.php' file inside the root folder for the plugin.
Any help would be most appreciated! Thank you! [/quote]
PHP Code:
<?php echo $url; ?>
PHP Code:
/*******************************************************
* @function nm_create_excerpt
* @param $content the post content
* @return a truncated version of the post content
*/
function nm_create_excerpt($content) {
global $NMEXCERPTLENGTH;
$len = intval($NMEXCERPTLENGTH);
$content = strip_tags($content);
if (strlen($content) > $len) {
if (function_exists('mb_substr'))
$content = trim(mb_substr($content, 0, $len, 'UTF-8')) . '...<p><a href="<?php echo $url; ?>"><button type="button" class="btn btn-readmore">Read More</button></a></p>';
else
$content = trim(substr($content, 0, $len)) . '...<p><a href="<?php echo $url; ?>"><button type="button" class="btn btn-readmore">Read More</button></a></p>';
}
return "<p>$content</p>";
}
It's on the 'functions.php' file inside the root folder for the plugin.
Any help would be most appreciated! Thank you! [/quote]