WordPress Development Asked by nikname on October 27, 2020
I want to add custom field, named score, for each post individually and store it in database so I can later order posts by that field. I need to make it available on post edit to change this value, so it would basically be an input text field which accept numbers 0 to 5. To do this, do I have to create custom post type, or is there a way to achieve it with ordinary posts section?
The easiest approach would be to use the Advanced Custom Fields plugin.
A quick example for your situation (this example assumes you have access to your theme files, and can update the PHP for output of the 'Scores' field):
WP_Query
to load and sort the posts by your new 'Score' fieldGood luck!
Answered by Pixelsmith on October 27, 2020
1 Asked on October 30, 2021
0 Asked on October 30, 2021 by thredolsen
1 Asked on October 30, 2021 by yogesh
0 Asked on October 30, 2021 by zian-tap-chan
1 Asked on October 30, 2021 by shubhamk
1 Asked on October 30, 2021 by user191925
0 Asked on October 30, 2021 by gabriel-borges
1 Asked on October 30, 2021 by asif-mughal
2 Asked on October 30, 2021 by j-bizmai
1 Asked on October 30, 2021 by houssameddin
1 Asked on October 30, 2021 by ncti
0 Asked on October 30, 2021 by user191642
1 Asked on October 30, 2021 by moorewebx
1 Asked on October 30, 2021 by brian-bruman
Get help from others!
Recent Answers
© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP