I had tried to find out how to add "read more" on my blogger and followed someone's guide as below - which I noticed there is the limitation.



DO NOT FOLLOW THIS WAY.

THE CORRECT VERSION IS IN THE BOTTOM OF THIS POST.




1. Add the below right before <head>

<style>

<b:if cond='data:blog.pageType == "item"'>

span.fullpost {display:inline;}

<b:else/>

span.fullpost {display:none;}

</b:if>

</style>


</head>


2. Add the below code after <data:post.body/>

<div class='post-body'>

<p><data:post.body/>

<b:if cond='data:blog.pageType != "item"'>

<a expr:href='data:post.url'>(Read more inside ..)</a>

</b:if>
</p>

<div style='clear: both;'/> <!-- clear for photos floats -->

</div>


3. Settings | Formatting | Post Template

Add the below and save.

<span class="fullpost"">



</span>
If you apply the above code, the below are the results.

1. Looks Work





2. Not really

1) Firefox does not work





2) If you have a short post and don't add the below code in the post, the browser still shows "Read more".

<span class="fullpost"">



</span>


FOLLOW THIS WAY. IT RESOLVES THE ABOVE.



1. Make sure you have the back up of the current template XML.

2. Add the below right before </head>

<b:if cond='data:blog.pageType != &quot;item&quot;'>

<script type='text/javascript'>



var fade = false;

function showFull(id) {

var post = document.getElementById(id);

var spans = post.getElementsByTagName('span');

for (var i = 0; i &lt; spans.length; i++) {

if (spans[i].id == &quot;fullpost&quot;) {

if (fade) {

spans[i].style.background = peekaboo_bgcolor;

Effect.Appear(spans[i]);

} else spans[i].style.display = 'inline';

}

if (spans[i].id == &quot;showlink&quot;)

spans[i].style.display = 'none';

if (spans[i].id == &quot;hidelink&quot;)

spans[i].style.display = 'inline';

}

}





function hideFull(id) {

var post = document.getElementById(id);

var spans = post.getElementsByTagName('span');

for (var i = 0; i &lt; spans.length; i++) {

if (spans[i].id == &quot;fullpost&quot;) {

if (fade) {

spans[i].style.background = peekaboo_bgcolor;

Effect.Fade(spans[i]);

} else spans[i].style.display = 'none';

}

if (spans[i].id == &quot;showlink&quot;)

spans[i].style.display = 'inline';

if (spans[i].id == &quot;hidelink&quot;)

spans[i].style.display = 'none';

}

post.scrollIntoView(true);

}



function checkFull(id) {

var post = document.getElementById(id);

var spans = post.getElementsByTagName('span');

var found = 0;

for (var i = 0; i &lt; spans.length; i++) {

if (spans[i].id == &quot;fullpost&quot;) {

spans[i].style.display = 'none';

found = 1;

}

if ((spans[i].id == &quot;showlink&quot;) &amp;&amp; (found == 0))

spans[i].style.display = 'none';

}

}



</script>

</b:if>


</head>


3. Add the below code after <div class='post-body'

<div class='post-body' expr:id='"post-" + data:post.id' >

<b:if cond='data:blog.pageType == "item"'>

<style>#fullpost{display:inline;}</style>

<p><data:post.body/></p>

<b:else/>

<style>#fullpost{display:none;}</style>


<p><data:post.body/></p>

<span id='showlink'>

<a expr:href='data:post.url'>Read More......</a>

</span>

<script type='text/javascript'>

checkFull("post-" + "<data:post.id/>");

</script>

</b:if>


<div style='clear: both;'/> <!-- clear for photos floats -->


4. Settings | Formatting | Post Template

Add the below and save.

<span id="fullpost"">



</span>


Now if you apply this correct version, you will see the below results which are all good.

1. Firefox





2. Short Posts that does not have the below code.

<span class="fullpost"">



</span>


If you use the second version above, you will be cool!







If this post is useful,
please subscribe this at
please bookmark, digg, or share this page at



Related Posts by Categories



26 comments

  1. Ladyheart // July 12, 2008 6:36 AM  

    er, sorry dear.. but I couldn't save all the edited html above. I am using the new blogger.
    The code in your guide couldn't be parsed correctly. huhu

  2. Ssannara // July 12, 2008 10:58 AM  

    Hi Ladyheart, Plz try the second step of the correct version above. This is the matter of how the post shows &amp; to &, &lt to <, and so one which caused your XML could not be parsed. Anyway, I corrected the post and reposted for the source part above.
    Thanks for letting me know. :)

  3. রাশেদ // July 28, 2008 7:15 AM  

    Shuold I add this code before head or /head?

    Plz inform.

  4. রাশেদ // July 28, 2008 7:25 AM  

    I got it! Thanks. :)

  5. Ssannara // July 28, 2008 10:51 AM  

    Great! The code should be right before </head>.

  6. রাশেদ // July 30, 2008 6:02 PM  

    2. Add the below right before "head"
    -----

    I think it would be nice if u correct the typo. :)

  7. Ssannara // July 30, 2008 6:30 PM  

    Oops~ I did not aware... Anyway I corrected the typo from <head> to </head>. Thanks for letting me know.

  8. hackcastle // August 8, 2008 6:53 AM  

    Need a lil help here!!...m not able to find 'div class='post-body'' tag in my blogger template.....plz help maai

  9. Ssannara // August 8, 2008 10:03 AM  

    hackcastle, It's not possible the tag is not existed. I see your blogger that I can find out the tag <div class='post-body'>.
    Please try to find out again.

  10. রাশেদ // August 8, 2008 12:28 PM  

    Look for post-body. Somethimes quation marks are converted to some kinda code. So u may not find the exact whole line.

    Also, look for !-- (Main) -- or div class='contentwrapper'. Post-body should be below it.

  11. রাশেদ // August 11, 2008 11:18 AM  

    Can I translate this tutorial with proper acknowledgements?

  12. Ssannara // August 11, 2008 11:27 AM  

    You can post this tutorial in another language with the name of my blogger and the URL (source). Good Luck!

  13. রাশেদ // August 11, 2008 8:05 PM  

    Thanks a lot. :)

  14. EasyAdsenseVn // September 3, 2008 6:53 AM  

    Thanks for your method. However, there are some inconveniences for this method. What are these inconveniences? Please visit my blog http://easyadsensevn.blogspot.com/2008/09/how-to-add-blogger-read-more-expandable_02.html for more details. Thanks again for your useful post!

  15. Ssannara // September 4, 2008 9:25 AM  

    Thank you, EasyAdsenseVn!

  16. Herman // October 20, 2008 10:20 PM  

    Ssannara, can u tell me how to post "? because when i write down the " it will turn into ("). How to make it stay remain? plz help me. thanks

  17. Ssannara // October 21, 2008 9:37 AM  

    Hi Herman, I am not quite sure what you exactly asking. If you are asking to enter the double quotation when you post the article, you need to type &quot; and it interprets and shows ". Please let me know if you are asking something else.

  18. Corro'll Driskell(MCT/MODL) // October 29, 2008 5:05 AM  

    Does your script change the display of long postings for blogs that exist prior to making the changes?

  19. Antifa Meran // November 8, 2008 2:36 PM  

    hello i loooooooove you!

    thx i tried at least five versions to make this, and everyone failed!

    super, thanx a lot!

    PS. One mistake:
    id="fullpost""




    there are two ("), but there has to be only one!
    thanx again, your're great

  20. invest_klse // January 4, 2009 10:09 AM  

    hi,

    thanks a lots for your code. It's exactly what I want. It really working to solve the short post problem.

    but I found that my long post is shown full in firefox.

  21. invest_klse // January 4, 2009 10:17 AM  

    Can you help to check my code?

    I can't figure out why it's doesn't work for firefox. (it's work well in IE).

    my blog is www.investment-klse.blogspot.com, it's in chinese language, hope you don't mine.

  22. ABU ABDILLAH // March 24, 2009 7:52 AM  

    Hello, i do copy and paste the code right the code that gaiven. But all my post was dissapear. How to solve this. May you can help me to solve out this prob. Thanks

  23. GlobetrotterSA // April 7, 2009 7:14 PM  

    SSannara, great post! I implemented this on a long blog post of mine and it works very well. However... the blog post is not crawled by Google search!? Did you experience this?

    I cannot find http://globetrottingonline.blogspot.com/2009/04/why-i-use-firefox.html in Google search at all.

    However, if you go to my blog homepage, the posts that were submitted after the one mentioned above, do appear in Google. Maybe google's crawler does not link this solution where the text is hidden by using your solution...?

  24. Admin // July 7, 2009 1:02 PM  

    I maked translate for blogger in my blog..Read more (devamını oku)

  25. Ray // August 1, 2009 9:25 AM  

    Hi - Just wanted to say thanks for this tip. I'd used a number of other read more hacks, but they always displayed read more on short posts. Now I can select the posts I want. Anyone interested, you can see this working at www.testertroubles.com

  26. Anonymous // September 14, 2009 7:34 PM  

    It doesn't look like you are paying attention to posts anymore; BUT, I was looking for "read more" code to add - came across this posting - wanted to add it - BUT, don't dare now because at least two VERY DISTURBING comments have been unanswered!

    1- Posts using this code are not indexed by GOOGLE?!!

    2- It doesn't work in Firefox?!!

    a- does it foul up Google spiders?
    b- does it or doesn't it work in firefox?

    thanks

    DJ
    http://offroadinghome.blogspot.com/

Post a Comment