Skip Navigation

[Resolved] Field not available under "Ordering"

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 18 replies, has 2 voices.

Last updated by Shane 5 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1293803
Image 2019-07-17 at 9.36.24 AM.png
Image 2019-07-17 at 9.35.55 AM.png

I am trying to: Order my results by the field "_campaign_startdate" and while I can display the field in the "Content Template" it is not available for selection in "Ordering"

#1293933

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Susan,

I tried to login to the site but the credentials don't seem to work.

However it seems that this is a hidden field. Could you go to Toolset Settings -> Frontend -> Hidden custom fields and enabled it.

Thanks,
Shane

#1293937

My issue is resolved now. Thank you!

#1294041
Image 2019-07-17 at 1.26.28 PM.png

On this ticket I have another issue. I am putting in the start date on a form using the following code :

    $fields['startdate'] = array(
        'label'       => 'Project Start Date',
        'type'        => 'datepicker',
        'priority'    => 99, 
        'value'       => $form->get_campaign_value( 'startdate' ),
        'data_type'   => 'meta',
        'editable'    => false,
        'placeholder' => 'Start Date',
    );

The issue is that it orders alphabetically not by date (see attached image). This happens regardless if I select "native custom field" , "string", or "number". I need it to sort by the actual date. So April 30, 2018 would be before April 1, 2020.

Can you please tell me what I am doing wrong ? By everything I have researched it should work.

#1294085

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Susan,

Which plugin is it that is generating this date field ?

Please let me know.
Thanks,
Shane

#1294149

Shane,

It isn't a plugin. It is in my functions.php and is a field added to a form. The main form is generated by the Charitable plugin.

Thanks,
Susan

#1294153

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Susan,

So you're saying the field isn't being sorted by views correct?

How is this field stored in the database, as a date or is it stored as a timestamp.

Thanks,
Shane

#1294155

Yes it isn't being sorted by views.

I would think it is being stored as a date since I use the datepicker to create the entry. I am not sure how to check.

#1294161

I can renter the login details if that will make it easier.

#1295033

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Susan,

To check, you will need to go in your database and search for the field itself.

However if you provide the credentials I can check using the wpv-post-field shortcode for you. The private fields will be enabled for your next response.

Also please let me know the post type that this field is on.

Thanks,
Shane

#1295037
#1295039

The post type is on the Campaign post type through the Charitable campaign.

#1295061

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Susan,

I believe the issue is with the Post with April 2015. Could you change the date there and see if the issue still remains?

All the other posts are actually ordered correctly so this one should be as well.

Thanks,
Shane

#1295067

Hi Shane,

I created a new entry and it is definitely not sorting correctly. It has July 19, 2019 sorted before April 17, 2019

Thanks,
Susan

#1295217

Hi Shane,

Any update on this ? Suggestions on what could be wrong ? I really need to get this site finished and this is holding me up.

Thanks,
Susan