GetSimple Support Forum

Full Version: SOLVED: Link in Read More button not working. Help!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
PHP Code:
<?php echo $url?>
to get the URL. It does not work in this instance. Here is what I have:

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($content0$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($content0$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! Smile[/quote]
Hello ccrouleau,

yes it is supported (and very good), and it has its own thread: News Manager (updated)

And for your read more link it should be possible just to turn on the function in Pages - News Manager - Settings: "Add "read more" link to excerpts:" Yes!

Hypertexter
(2015-03-17, 03:47:14)Hypertexter Wrote: [ -> ]Hello ccrouleau,

yes it is supported (and very good), and it has its own thread: News Manager (updated)

And for your read more link it should be possible just to turn on the function in Pages - News Manager - Settings: "Add "read more" link to excerpts:" Yes!

Hypertexter

Thank you for your reply! Unfortunately, I do not have the option to 'Add Read More Link to Exerpts". Here is a screenshot. Maybe I'm missing something? I should have the latest version of the plugin (v2.2.4)
[Image: NM+SS.png]
Hi,

you could try NM 3.1.

But seems you are good in PHP, so if you want to invent something new... why not? Big Grin

Hypertexter
(2015-03-17, 03:59:04)Hypertexter Wrote: [ -> ]Hi,

you could try NM 3.1.

But seems you are good in PHP, so if you want to invent something new... why not? Big Grin

Hypertexter

That did it, thank you!! Smile