How to set year as current year

  • Unknown's avatar

    foreach($media_items as $media_item) {
    $date_key = strtolower(date( ‘F_Y’, strtotime($media_item->post_date) ));
    $date_key_maps[$date_key] = date( ‘F Y’, strtotime($media_item->post_date) );
    if(is_array($media_items_list[$date_key])) {
    $media_items_list[$date_key][] = $media_item;
    } else {
    $media_items_list[$date_key] = array(
    $media_item
    );
    }
    }

  • Unknown's avatar

    i would like to show the listing based on current year instead show all years listing.

    else {
    $media_items_list[$date_key] = array(
    $media_item
    );
    }

    seeking your guides.

    Thanks

  • Hi there,

    Your site is not hosted on WordPress.com, but using the open source WordPress.org software at another hosting provider.

    Please contact support for the plugin you’re trying to modify directly for help with this.

    For general help with the version of WordPress you’re using, you can ask the WordPress.org community over at https://wordpress.org/support/forums/

  • The topic ‘How to set year as current year’ is closed to new replies.