Quantcast
Viewing all articles
Browse latest Browse all 444

news order in search page

hi

in search page, the news list is with title (or titlelink ?) order, but I want to list them with date (recent first) (as the default order in news loop on news page).
I have a look on next_news() paramaters, but there is no choice to do that.
In deprecated functions, I have the info that we have to set news order type and news order direction.

so I write this code in my search page:

<?php  if ($_zenpage_and_news_enabled && ($numnews > 0)) {
        $_zp_current_search->setSortType('date', 'news');
        $_zp_current_search->setSortDirection(1, 'news');
        ?>
        <h4 class="margin-top-double margin-bottom-double"><strong><?php printf(gettext('Articles (%s)'), $numnews); ?></strong></h4>
            <?php while (next_news()) { ?>
                <div class="list-post clearfix">
                    <h4 class="post-title"><?php printNewsURL(); ?></h4>
                    <div class="post-content clearfix">
                        <?php echo shortenContent(getBare(getNewsContent()), 200, getOption("zenpage_textshorten_indicator")); ?>
                    </div>
                </div>
            <?php
            }
    } ?>

but it has no effet on news order.
what is wrong ?


Viewing all articles
Browse latest Browse all 444

Trending Articles