Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

[SOLVED] Sorting by modification date


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Feb 16, 2013, 05:37 AM
arteny
 
22 posts · Nov 2012
Russia, Voronezh
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.

Last edited by arteny; Feb 16, 2013 at 09:07 AM.
  #2  
Old Feb 16, 2013, 07:39 AM
lmilesw's Avatar
lmilesw
 
10,054 posts · Jul 2009
Central New York State USA
I would use the List Category Posts plugin.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Feb 16, 2013, 11:55 AM
arteny
 
22 posts · Nov 2012
Russia, Voronezh
Quote:
Originally Posted by lmilesw
I would use the List Category Posts plugin.
lmilesw, I installed it, but didn't understand how to use it. I got that I should write
[catlist categorypage="yes" orderby=modified]
But where should I put this pseudo-code?
  #4  
Old Feb 16, 2013, 12:11 PM
juggledad's Avatar
juggledad
 
21,986 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
you put shortcodes in posts or pages
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #5  
Old Feb 16, 2013, 12:28 PM
arteny
 
22 posts · Nov 2012
Russia, Voronezh
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.
  #6  
Old Feb 16, 2013, 01:04 PM
juggledad's Avatar
juggledad
 
21,986 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
you could try making a child theme and using the is_main_query function to change the main query.
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #7  
Old Feb 16, 2013, 02:47 PM
lmilesw's Avatar
lmilesw
 
10,054 posts · Jul 2009
Central New York State USA
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.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #8  
Old Feb 16, 2013, 03:31 PM
jerryc
 
367 posts · Oct 2012
Florida
If you can do it with php, you might be able to use the technique shown in this post.
  #9  
Old Feb 17, 2013, 02:16 AM
arteny
 
22 posts · Nov 2012
Russia, Voronezh
I found the solution:
use this snippet:

Code:
function order_posts_by_mod_date($orderby) {
  if  (is_home() || is_archive() || is_feed()) {
    $orderby = "post_modified_gmt DESC";
  }

  return $orderby;
}

add_filter('posts_orderby', 'order_posts_by_mod_date', 999);
just dump this snippet into functions.php

Bookmarks

Tags
modification date, sorting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PATCH 373-03: date-modified in post/page info items returns the date published juggledad Old Version fixes and change logs 0 Dec 30, 2011 06:41 PM
Page Menu drop down modification - remove arrows & extra space dorigen Page & Category Menu Bars 30 Mar 10, 2011 06:26 PM
Modification article lecalve Atahualpa 3 Wordpress theme 0 Mar 23, 2010 04:33 AM
Page Menu Bar Sorting Dem Page & Category Menu Bars 5 Mar 6, 2009 03:22 PM


All times are GMT -6. The time now is 03:49 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.