Tagged: Alphabetical, archives
-
AuthorPosts
-
November 2, 2015 at 8:16 am #528284
First it’s important to note that I’ve customized my archive page already to create the sidebar I need to the left. And I’ve also customized my avia builder with the ability to sort posts alphabetically.
I’ve tried every suggestion in the forums to sort my archive pages automatically alphabetically but I’m getting nowhere. None of the solutions work. Including the suggested additions to the functions.php file. I’ve left those in place for your reference. I’ve also tried every available plugin I can find as well. No dice. I’m just not quite savvy enough understanding the relationship with the avia builder to work through this.
Any suggestions?
- This topic was modified 9 years, 1 month ago by grooveva.
November 2, 2015 at 5:05 pm #528633Hey grooveva!
Try adding this to the bottom of your functions.php file.
add_action( 'pre_get_posts', 'enfold_customization_archive_order', 50, 1 ); function enfold_customization_archive_order( $query ){ if ( $query->is_archive() ) { $query->set( 'order', 'ASC' ); } return $query; }
Cheers!
ElliottNovember 3, 2015 at 5:25 am #528983I gave that a go as you can see in my child theme but no luck with that.
November 3, 2015 at 11:36 pm #529666Just following up, the suggested code definitely doesn’t work. As is everyone on the forums no doubt, we are anxious to get this to our end client but we can’t deliver until we come up with a solution.
- This reply was modified 9 years, 1 month ago by grooveva.
November 4, 2015 at 5:33 pm #530268Hi!
Can you please try following code
add_filter( 'pre_get_posts', 'enfold_customization_archive_order' ); function enfold_customization_archive_order( $query ) { if ( $query->is_archive() ) { $query->set('order', 'ASC'); $query->set('orderby', 'modified'); } }
Best regards,
YigitNovember 4, 2015 at 8:43 pm #530398No change at all unfortunately. I’m including my site logins again below.
November 5, 2015 at 9:07 am #530594Hey!
We tried to login to the site but it’s not working. Please check. Replace the code with this:
add_action( 'pre_get_posts', 'pre_get_posts_post' ); function pre_get_posts_post( $query ) { if( $query->is_archive() ) { $query->set('orderby', array('title' => 'ASC')); } return $query; }
Works on our installation.
Best regards,
IsmaelNovember 5, 2015 at 9:25 am #530606Yeah something must be conflicting I’ve reset your temp admin password see below. I’d wager it’s the custom code for the avia builder to alphabetize post output that’s borking these attempts but I’m not savvy enough to prove it.
- This reply was modified 9 years, 1 month ago by grooveva.
November 5, 2015 at 11:00 am #530651Hi!
The code works OK on our installation but it doesn’t seem to be doing anything when we added it in your functions.php file. What happens if you disable the archive.php file in the child theme folder?
Regards,
IsmaelNovember 5, 2015 at 11:12 am #530661no change so I suppose it’s safe to say the custom archive page isn’t the culprit.
November 7, 2015 at 6:20 am #531723 -
AuthorPosts
- You must be logged in to reply to this topic.