Need to add a post’s featured image to a section on the frontpage
Need to add a post’s featured image to a section on the frontpage
Need to add a post’s featured image to a section on the frontpage
redirect after submiting post for review
I don’t know what you want to do besides checking the meta so i’m gonna give a very basic example. function bt_check_saved_post_meta ($post_id) { if (!empty(get_post_meta($post_id, ‘some_meta’, true))) { // do something here } } add_action(‘save_post’, ‘bt_check_saved_post_meta’);
How to put search bar & logo in the “primary navigation” storefront theme?
Using Ajax to submit a form, and run a SQL Select query based on user input from the form
Is there way to toggle the publish date display?
How to remove/hide collapse menu for user/subscriber?
Page not visible in ‘All pages’ after being added through PHP
As others have already noted in the comments, using “posts_per_page” => 5, is better option than “posts_per_page” => -1, for your query as it will give you the information you need for your conditional check. Limiting what is queried is also something to consider – as honk31 mentioned. Along ‘fields’ => ‘ids’ you can also … Read more
This should work. Untested though. I don’t know how you get $woocomerce_wookc_text, but since you mentioned CMB, I am taking you are saving it as product meta data function wpse405916_add_to_cart( $cart_item_key, $product_id ) { //Get the woocomerce_wookc_text value. $woocomerce_wookc_text = get_post_meta( $product_id, ‘woocomerce_wookc_text ‘, true ); //Check if the value exists if ( $woocomerce_wookc_text && … Read more