Is your site available online? I would like to take a look inside your wp-admin area to see why this isn't working as expected. If I need to make any changes, I will create a clone of your site using the Duplicator plugin, so I can install your site locally and make changes here. If that's okay with you, please provide login credentials in the private reply fields here. I will take a closer look.
Oh I see, this is a bit of a limitation with WordPress that I should have mentioned. When you sort based on some value, if the value does not exist for a result then the result does not get included in search results. I think the best way to handle this is to assign a placeholder value to post-place for those items instead of an empty value. That placeholder can be "*" if you want them to appear before ordered search results, or "Z" if you want them to appear after ordered search results.
bsd
I thought about that - and tried to make a default value to the post place field as 99999999 to be sure it will be after the ordered posts.
I do not undertand why you wrote to use a s tring field if we are talking about a number field.
But we have already about 400 posts - do we have to full them manually one by one?
Thanks
But we have already about 400 posts - do we have to full them manually one by one?
There are several options you can try to help automate this:
- Create a CSV file that includes the defaults and import these values into your postmeta table. More information about importing data can be found here: https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/
- Write a custom PHP script that adds the appropriate post meta values using WordPress add_post_meta. Run the script on your server, then remove it from your server. More information about this can be found here: https://codex.wordpress.org/Function_Reference/add_post_meta
- Write a custom SQL script that inserts values into your postmeta table automatically. Use phpMyAdmin or another SQL interface to run this script on your database. More information about that can be found in the MySQL documentation: hidden link