Mwaziba Posted January 5, 2021 Share Posted January 5, 2021 Hi there, I have a blog on books and I would like to organise them in alpahbetical order. All the book titles are entered as blog titles. Can anyone help me? Link to comment
0 Mwaziba Posted January 5, 2021 Author Share Posted January 5, 2021 I meant I have a website on with different blog posts as book titles. Link to comment
0 tazmeah Posted January 6, 2021 Share Posted January 6, 2021 Can you post a link so we can better understand your problem? Link to comment
0 Mwaziba Posted January 6, 2021 Author Share Posted January 6, 2021 https://www.mwaziba.com Under "The Hub" the only way I can categorise is by tags which I have grouped into "themes". However, I would like all the books in alphabetical order which is labelled as page title on the website. Link to comment
0 Mwaziba Posted January 6, 2021 Author Share Posted January 6, 2021 17 hours ago, tazmeah said: Can you post a link so we can better understand your problem? Thank you for your reply. Link to comment
0 tazmeah Posted January 6, 2021 Share Posted January 6, 2021 Are you saying you want the Category names alphabetized: Category "A", Category "B", ....Category "G", or are you saying you want the books within the categories alphabetized: Category "G" - Books "A", "B",..."Z", Category "C" - Books "A", "B",..."Z" or are you saying alphabetize them both? tuanphan 1 Link to comment
0 derricksrandomviews Posted January 12, 2021 Share Posted January 12, 2021 This thread should be helpful, be sure to read the whole thing: Mwaziba 1 Link to comment
0 Teucer90 Posted January 14, 2021 Share Posted January 14, 2021 This code worked for me to alphabetize blog posts based on title name: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ if( $('.blog-item').length != 0 ){ var categories = []; $('.blog-item').each(function () { categories.push({ categoryName: $(this).find('.blog-title').html(), listItem: $(this) }); }); categories.sort(function(a,b) { var c = a.categoryName.toUpperCase(); var d = b.categoryName.toUpperCase(); return (c > d) ? 1 : ((d > c) ? -1 : 0); }); $.each(categories, function(index, object){ object.listItem.appendTo(object.listItem.parent()); }); } }); </script> The only issue is that the pagination links at the bottom won't be alphabetized as well, so I had to hide them. If anyone has solved this problem I'd love to see that solution Mwaziba 1 Link to comment
0 tuanphan Posted January 17, 2021 Share Posted January 17, 2021 On 1/14/2021 at 11:40 PM, Teucer90 said: This code worked for me to alphabetize blog posts based on title name: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ if( $('.blog-item').length != 0 ){ var categories = []; $('.blog-item').each(function () { categories.push({ categoryName: $(this).find('.blog-title').html(), listItem: $(this) }); }); categories.sort(function(a,b) { var c = a.categoryName.toUpperCase(); var d = b.categoryName.toUpperCase(); return (c > d) ? 1 : ((d > c) ? -1 : 0); }); $.each(categories, function(index, object){ object.listItem.appendTo(object.listItem.parent()); }); } }); </script> The only issue is that the pagination links at the bottom won't be alphabetized as well, so I had to hide them. If anyone has solved this problem I'd love to see that solution If you share link to blog post, we can give code to hide it easier. Mwaziba 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
0 Mwaziba Posted January 20, 2021 Author Share Posted January 20, 2021 On 1/11/2021 at 5:22 PM, Ekaland said: r are you saying you want the books within the categories alphabetized: Category "G" - Books "A", "B",..."Z", Category "C" - Books "A", "B",..."Z" This is what I would like please. Is this possible? Link to comment
0 MidnightClub Posted January 21, 2021 Share Posted January 21, 2021 Hi @Mwaziba, I know the plugin lazy summary allows to automatically order alphabetically blog post within a summary block. Then you would have to create on your page a summary block per category, that you order manually, and all the post within would be rightly ordered. Seems the simpler to me. Cheers, Fabien Mwaziba 1 Link to comment
0 Mwaziba Posted January 21, 2021 Author Share Posted January 21, 2021 Overwhelmed with everyones responses. I will give the ones I find easier a go. Thank you so much 🙂 Link to comment
Question
Mwaziba
Hi there,
I have a blog on books and I would like to organise them in alpahbetical order. All the book titles are entered as blog titles. Can anyone help me?
Link to comment
Top Posters For This Question
1
2
6
1
Popular Days
Jan 6
4
Jan 5
2
Jan 21
2
Jan 17
1
Top Posters For This Question
derricksrandomviews 1 post
tazmeah 2 posts
Mwaziba 6 posts
Teucer90 1 post
Popular Days
Jan 6 2021
4 posts
Jan 5 2021
2 posts
Jan 21 2021
2 posts
Jan 17 2021
1 post
Popular Posts
tazmeah
Are you saying you want the Category names alphabetized: Category "A", Category "B", ....Category "G", or are you saying you want the books within the categories alphabetized: Category "G" - Books
derricksrandomviews
This thread should be helpful, be sure to read the whole thing:
Teucer90
This code worked for me to alphabetize blog posts based on title name: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <scr
11 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment