Now how to implement this :-
You should have label widget installed in your blog to proceed further.
Now go to Dashboard > Layout > Page Elements > Edit Html Page > Expand Widgets
Now search for below code within the html,
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'>
<data:label.name/>
</a>
</b:if>
<span dir='ltr'>(<data:label.count/>)</span>
And replace the above codes with below:-
<a expr:dir='data:blog.languageDirection' expr:href='data:label.url + "?max-results=2"'>
<data:label.name/>
</a>
</b:if>
<span dir='ltr'>(<data:label.count/>)</span>
The digit 2 in red in above code tell how many posts you want to show in label pages.So change it to any number as how much posts you want to see in your label pages.And if you have many posts in label pages and want to show all then use this hack how to show only post titles in label pages.It will be very helpful for you.
That's it We have successfully added " Show Specific Number of Posts in Labels Page " . here after your Blog Will Show only specific number of posts in Labels Page. I hope This Hack will be useful for you all. If you have any doubts or difficulties in implementing this Hack please let me know in comments.



26 comments:
im using a cloud label and i am unable to find that code in my template pls help
#labelcloud is defing the css in your html before
:skin code
And its defined as
div id='labelCloud'
delete the complete widget div id widget then it will ork as normal label but Please back up your template before making any changes.
Hi,
I also use the Labels Cloud, and now I can't specific the nb of posts to show.
I don't want to remove the Labels Cloud !
If you can help it will be much appreciated !
Thks.
@Max sorry friend if you are usign label cloud you can't implement it...
thanxs!! anshul , your all d tricks are mind-blasting.
it works perfectly.
i am not using label loud....i found that line and when i changed the and saved the template it is showing an xml error msg....what to do...
I changed the code to show this (without <>):
a expr:dir='data:blog.languageDirection' expr:href='data:label.url + "?max-results=100"'
And I only still get 20 posts.
http://dressdiary.blogspot.com/search/label/Updated
This label has 51 posts and counting.
Here is my code:
http://docs.google.com/View?id=df5njb3x_14hg9m5rdc
in your codes hack is not implemented. Do again.
i dont use cloud but i get this error
The element type "li" must be terminated by the matching end-tag "".
What to do ?
@footbal you can't get error like this while adding above codes.
Thank u Anshul - Youre my HERO ! :) I had tried 3 other methods , and none of them worked- this one DID ! I also thank you for converting & IMPROVING the Irresistible Theme ( I had the original ) ; but I removed it and installed yours . Its awesome ! Thank you , Thank you & THANK YOU ! :))
Mia
@mia Thanx !!
Great article, did exactly what I was looking for. Thanks again!
Anshul - I know this hack will not work with the label cloud widget ( which is what I have on my theme ) - but , I was wondering : Is there a similar hack which can be implemented to work like this with the Archives and the Link List widgets ? Please say yes :( I really need something like this - because when someone clicks on my Archives and my Categories [ which is my Link List ] the posts run on FOREVER ! and I only want 4 posts to be displayed -both on the Archives and in the Categories - please help me Anshul :((
Hope everything is going good with you - are you done with your studies yet - or still knee deep in the books ?
Will await your reply .
Be well Anshul Dudeja !
Mia
@mia zoe yes in clouds it wont work.But if you making links for categories in linklist just add this after that link ?max-results=4 then only 4 posts will open for that category.and for archive i dont know. I never tried and no one asked i will check and tell you.
And ya its my last year to study in deep books :)
It doesnt work Anshul :(( nothing seems to be working :(( Im gonna shoot my theme :((
@mia se your category links you have made it like this.
http://www.dezigndiva.com/search/label/Resources?max-results=4?max-results=4
Its wrong just make like this
http://www.dezigndiva.com/search/label/Resources?max-results=4
Then it will work fine.You can even check by opening the link i told to make and browse through and can see it works.
OK Anshul - I had implemented the ?max-results=4 into the source as well, and had forgotten about it - this is why it wasnt working - once I removed it - then it worked just fine ( although- I am still NOT having any luck with the Archives section - I guess thats a tough one , even for you to get around , so Im just gonna stop trying to achieve the impossible at this point and just be happy with things as they are - nobody's perfect ! ) . I thank you once again for saving the day , my blog and me from shooting myself ! :D I want to wish you good luck with your exams ( which I am confident you will ACE ! with eyes closed !!! :D ) - Dont be nervous - just BELIEVE in yourself Anshul Dudeja - YOU CAN DO IT !!!
Let me know how everything turns out - even though I know you will not get anything lower than 9.8 ! ;)
Be well Anshul Dudeja !
Best wishes across the miles : Mia
I'd really like to know if there is a tag or something with which I could count the number of posts on my blogs; e.g. something like data:posts.count or something.
Please tell me if you know :)
Thanks
@tezuka read it will help
http://www.anshuldudeja.com/2008/11/statistics-widget-for-blogger.html
anshul, it seems to be not working in the new blogger design, pls help...
@rocky it would be working may be you would be wanting to show more and blogger would have restricted auto due to auto pagination.
Thanks for reply :) How can I do this?
@rocky read this you didnt got me
http://buzz.blogger.com/2010/02/auto-pagination-on-blogger.html
Thx for the info bro :)
That worked for the labels, but how to set certain number of posts to be shown on my home page, there are 5 atm and I can't change em in any way :/ Tried in settings/formating already and didn't worked :|...
Post a Comment