2 Replies - 1482 Views - Last Post: 01 May 2009 - 09:20 AM

#1 papuccino1  Icon User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 62
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Creating a 'Read More of This Post' link to my blogspot posts.

Posted 19 April 2009 - 06:06 PM

Hey guys, this is my first post here in the Blogging section of the site. I was wondering if it was possible to create a 'Read More' link to every post I make.

I write pretty long posts and I don't want every single post to show up at the home page.

Here's my site so you can see why I need this option for my blog.

My Blog

Thank you :D

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a 'Read More of This Post' link to my blogspot posts.

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 942
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Creating a 'Read More of This Post' link to my blogspot posts.

Posted 01 May 2009 - 08:55 AM

View Postpapuccino1, on 19 Apr, 2009 - 05:06 PM, said:

Hey guys, this is my first post here in the Blogging section of the site. I was wondering if it was possible to create a 'Read More' link to every post I make.

I write pretty long posts and I don't want every single post to show up at the home page.

Here's my site so you can see why I need this option for my blog.

My Blog

Thank you :D


I do it all the time on my blog. I write an intro to the tutorial and post a link to the actual tutorial. I have a website and use the:

*edit*
I go to the HTML view, you could just use the link button.

<a href="http://www.domain.com/index.html>Link</a>



What you could do is find a free hosting service, if you don't have hosting, create web pages there and use the link to send your readers to the pages. Hope that helps. :)

*edit*
I went to your blog, didn't understand anything but the code. :P I had a slight problem having the code come out nice too, no spacing and lines would wrap over unpredictably.

This post has been edited by SixOfEleven: 01 May 2009 - 09:04 AM

Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1632
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Creating a 'Read More of This Post' link to my blogspot posts.

Posted 01 May 2009 - 09:20 AM

If you're working with PHP you can create a function that truncates the length (that you provide, or use a default value). Here's an example of accomplishing this

/*   
** Function for truncating text and adding trailing characters
** default characters is the ellipse (...) but can be whatever the
** user chooses. The default length is 75 characters but the
** user can change that as well. The function has 3 parameters:
**
** $textToTruncate - The text we wish to truncate 
** $truncLen - Maximum length we want the text to be  
** $truncateChars - characters to append to end of truncated text
				  (default is the ellipse)
*/   

function truncateText($textToTruncate, $maxLength = 75, $trailingChars='...')   
{
	$maxLength -= mb_strlen($trailingChars);  
	
	if (mb_strlen($textToTruncate)> $maxLength)  
	{  
	   //Since we're here then the text is longer than
	   //the maximum length we wish to allow so we need
	   //to truncate the text and add the truncate characters
	   return mb_substr($textToTruncate,0,$maxLength).$trailingChars;  
	}  
	else  
	{
	   // string was already short enough, return the string  
	   $truncatedText = $textToTruncate;  
	}

	//return the truncated text
	return $truncatedText;
}



Hope this helps :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1