• Hi,
    i’m not sure how i can sort the result by Date?

    This is the code for the result page:

    <?php if (have_posts()) : ?>
    
    		<h3 class="pagetitle"><?php printf(__('Suchergebnisse: "%s"'), $s) ?></h3><br/>
    
    		<?php while (have_posts()) : the_post(); ?>	
    
        <div class="post" id="post-<?php the_ID(); ?>">
    			<?php $counter++; ?>
    
      <?php include(INCL.'/_post-header.php'); ?>
    			<div class="entry">
    				<?php the_content('Weiterlesen...'); ?>
    			</div><!--/entry-->
    <?php include(INCL.'/_post-footer.php'); ?>
    </div> <br/><!--/post-->
    
    		<?php endwhile; ?>

    But where must i place the:
    ‘orderby=post_date&order=DESC’

    Thanks,
    Manuel

Viewing 8 replies - 16 through 23 (of 23 total)
  • I changed the header(“Location: to hidden input fields and now both orderby working and also searching words with ” and ‘ .
    Somehow, it appears that the header redirect did something wrong to the search.

    Plugin Author Mikko Saari

    (@msaari)

    Well, the Premium license does include support, so if you’re having problems, I can definitely check to see if I can fix them.

    I just came to this post because I needed exactly the same thing – to sort results by date, not relevance. For one of my sites, relevance is determined by the post of the date. The further back in time, the less the importance of the information. So, for that site, relevance sorting is not why I use Relevanssi. Rather, I use it for its regex abilities and the number of results that are returned.

    Plugin Author Mikko Saari

    (@msaari)

    Well, the solution has already been mentioned in the thread.

    In Premium it’s possible to build a filter that gives extra weight for fresh articles. In this knowledge base entry you’ll find example of a filter that gives double weight for posts within last week and half weight for older posts.

    Yes, I applied the solution. I just wanted to add another voice to those who use the plugin because of the content it finds, but who don’t believe that sorting by relevance is always a prerequisite in order for the plugin to be useful. ??

    Plugin Author Mikko Saari

    (@msaari)

    Fine, fine, I give in – the option to change the default sort order is now available in Premium 1.5.6 and will be available in the free Relevanssi starting from version 2.9.1, which will be released shortly, I’m just waiting to confirm some other fixes.

    Thanks for this. Sorting by date is perfect for my site too. You have to be careful though every time you change your setting as the dropdown reverts to “relevant”.

    Plugin Author Mikko Saari

    (@msaari)

    It shouldn’t, I’ll check and fix that.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘[Plugin: Relevanssi] How to sort by Date?’ is closed to new replies.