WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Customizable Post Listings - Post Order (2 posts)

  1. BeddgelertWoodcraft
    Member
    Posted 6 years ago #

    I'm having a problem with the order posts are displayed. It should be simple really, but due to my lack of PHP I can't work out where I'm going wrong. I am calling the function from my sidebar with

    <?php _e('Recent News'); ?></h2><?php c2c_get_recent_posts(); ?>

    And have the function defined as;

    function c2c_get_recent_posts( $num_posts = 5,
    	$format = "<li>%post_date%<p>%post_URL%:</p>%post_excerpt_short%</li>",
    	$categories = '',		// space separated list of category IDs -- leave empty to get all
    	$orderby = 'date',
    	$order = 'DESC',		// either 'ASC' (ascending) or 'DESC' (descending)
    	$offset = 0,			// number of posts to skip
    	$date_format = 'j F Y h:i a',		// Date format, php-style, if different from blog's date-format setting
    	$authors = '',			// space separated list of author IDs -- leave empty to get all
    	$post_type = 'post',		// space separated list of post_types to consider (possible values: post, page, attachment)
    	$post_status = 'publish',	// space separated list of post_statuses to consider (possible values: publish, draft, private, pending, and/or future)
    	$include_passworded_posts = false,
    	$extra_sql_where_clause = '' )

    It looks really good however, I'd like to have the most recent post appear first in the list but changing '$order = 'DESC',' has no effect.

    Anyone know what I'm doing wrong?

  2. BeddgelertWoodcraft
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic