[SOLVED] Sorting by modification date
How to do it?
I can do it adding if( have_posts() ) : // begin of my code >> if (is_main_query()) : query_posts($query_string.'orderby=modified'); endif; // << end of my code into begin of bfa_loop function (montezuma/includes/template_tags.php file) but in this case all posts are shown each time not depend on if I select some tag or category. in correct order, but I don't need them all in those cases. |
I would use the List Category Posts plugin.
|
Quote:
[catlist categorypage="yes" orderby=modified] But where should I put this pseudo-code? |
you put shortcodes in posts or pages
|
In this case this plugin nothing helps me.
If I put this pseudo-code in post or page it really show me list of links to posts with correct order here. So I can do separate page which can show posts (excerpts are possible as well) with needed conditions. But I don't need this list. I want to keep current standard behavior of index page - when I can click on tag or on category and it shows filtered posts. Only I need posts previews are sorted by modified date. |
you could try making a child theme and using the is_main_query function to change the main query.
|
You can add the necessary attributes to the shortcode to show full posts, excerpts, images, etc. It might take a bit to understand completely how it works but I believe it will do what you want.
|
If you can do it with php, you might be able to use the technique shown in this post.
|
I found the solution:
use this snippet: Code:
function order_posts_by_mod_date($orderby) { |
All times are GMT -6. The time now is 05:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.