Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Set class if a meta value is set within post archive

i suggest you check the the value of $checkbox by either checking checkbox under meta_key column in wp_postmeta or *your prefix_postmeta table in your database or simply do var_dump($checkbox); for testing if its 0 or null or an empty string or so then your if condition will not return true and $has_video will not be assigned to ‘icon-has_video’.

Related Posts:

  1. Saving multiple custom meta box fields
  2. What is the index [0] for on post meta fields?
  3. Custom field metabox not showing in back-end
  4. How to hide meta box values from custom fields list?
  5. Create meta boxes that don’t show in custom fields
  6. How to break meta values into different items and avoid duplicates?
  7. Custom fields to save multiple values
  8. wp_handle_upload error “Specified file failed upload test” but still creates attachment?
  9. How to wrap meta values seperated by comma in ? [closed]
  10. How to create a Custom Meta Box with Name/Value Admin User Input Fields?
  11. Create Multiple File Upload Metabox in WordPress
  12. Run a check for multiple meta key values
  13. Button inside Custom Meta Box triggering the Update Button
  14. Why is my Custom Meta Box Field Inputs NOT saving?
  15. get_posts in meta box dropdown not showing latest posts
  16. How can you include custom post meta in search without calling each key?
  17. Display Custom Meta Box Field Only If Value is Present
  18. shortcode in a custom metabox
  19. Problem with saving large amount of data in postmeta/usermeta
  20. Move Title and the Content WYSIWYG editor position
  21. How to validate select field in post meta?
  22. IF Custom field value equals ZERO
  23. How to use media upload on metabox post page without breaking TinyMCE?
  24. Let’s Create Custom Field Template Documentation
  25. How add multiple wp_editor_box to new post
  26. Update post meta custom field using block editor
  27. Can I save post meta programatically without setting metaboxes?
  28. Meta box values are displayed on Custom Fields list. Is it possible to hide them?
  29. If metabox has content display content
  30. put saved metabox values back into fields and then display on the front end
  31. Add a class to post_class if more than one post shares same meta_value_num
  32. Show array of meta_value in Edit Post Coloum
  33. How to improve my non-unique metadata MySQL entries?
  34. WordPress Blocks, setAttributes not saving
  35. Allow HTML in Custom Metabox area
  36. Custom field metabox not showing in back-end
  37. Save, update, get and sanitize post meta as HTML not plain
  38. Create Meta boxes dynamically
  39. Get meta value when the page is a blog archive
  40. Can’t save meta field value if the title not set
  41. Display Data From This Custom Media Upload Meta Box?
  42. When post is updated, custom metadata in text area field is overwritten
  43. wp_postmeta are updated for only one page
  44. Custom Field: Display only if a specific key is selected outside the loop
  45. When editing a post with a custom meta box the values aren’t displaying correctly
  46. How to add new Metadata options (Date, Author, etc.) for Posts?
  47. WP Query Args – search by meta_key or title
  48. get Custom field label (select/dropdown) on front end
  49. Block Editor – Meta values not saved, meta changes to empty array on update
  50. Best way to programmatically remove a category/term from a post
  51. How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
  52. display specific custom fields
  53. Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
  54. Transients vs CRON +Custom Fields: Caching Data Per Post
  55. Unable to save datetime custom meta field using update_post_meta() function
  56. Create custom field on post draft or publish?
  57. get_post_meta fields don’t show up on posts page
  58. Add a post meta key and value only if it does not exist on the post
  59. Adding a custom field or metabox to the post-thumbnail widget?
  60. Function to change meta value in database for each post
  61. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  62. Get aggregate list of all custom fields for entire blog
  63. Woocommerce with metabox plugin
  64. trim custom field text value and show (…)
  65. using multiple meta_key and meta_value in query_posts
  66. MySQL Query that looks for post with Custom Field, then changes Category
  67. How Meta Data is different from Custom Fields of POST/PAGE in WordPress
  68. Tweak Meta for Post to work it for Pages also
  69. How to add a new meta key and assign timestamp to posts
  70. Read / Watch / Listen times – meta
  71. Custom Meta Box (SELECT) Not Saving
  72. Displaying multiple URLs as custom field values
  73. Limits, not all post are showen when querying for posts by view count
  74. Find a way to retrive data updated through metabox plugin to web page
  75. Looping inside block return
  76. Scripts and tags will not save or output from my custom meta box
  77. Sortable Custom Columns not sorting correct
  78. Using WP Color Picker in Repeatable Fields
  79. MetaBox not saving after empty
  80. How do I save Multiple fields in a meta box?
  81. Best way to achieve multiple links in a post title
  82. How to display data from custom fields I created?
  83. Custom Field & Gravity Forms [closed]
  84. custom filed from post in the side bar
  85. Working with multiple values and metaboxes
  86. Move the metaboxes to the very top of post editor
  87. How to speed up post list slowed by update_meta_cache()?
  88. non-unique #_ajax_nonce id in browser console
  89. Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
  90. Issue on Creating Checkbox Field On Custom Post type
  91. Why does this javascript search function in the WordPress Admin not work?
  92. 4 Unique Random Posts based on Custom Field Values
  93. Save input form on custom field
  94. Check if value exists before saving
  95. Meta Box Data added to header redirect
  96. Custom metaboxes not saving after switching themes
  97. Get fields from metabox array
  98. Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
  99. Dynamic background image used in css after selector
  100. save all acf options in one meta_value [closed]
Categories custom-field Tags custom-field, meta-value, metabox, post-class, post-meta
How to pull latest posts from a specific category
Product page not found if product data is set Appointment Service

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress