Custom field as meta description

If you want to fetch the data from a custom field named wpse_desc: then here’s one way to do that with your code snippet: function wpse_custom_meta_description() { // Nothing to do if ( ! is_single() ) return; // Fetch our custom field value $desc = get_post_meta( get_queried_object_id(), ‘wpse_desc’, true ); // Output if( ! empty( … Read more

Create new post with meta data using WordPress API

You need to register your meta field first, then you can insert / update it into a post using rest api. https://codex.wordpress.org/Function_Reference/register_meta $object_type=”post”; $args1 = array( ‘type’ => ‘string’, ‘description’ => ‘My Meta Key Description’, ‘single’ => true, ‘show_in_rest’ => true, ); register_meta( $object_type, ‘MyMetaKey’, $args1 ); Hope it helps

Display only past events on that page using Visual Composer Grid Bulider

Finally i got answer. post_type=event&meta_query%5B0%5D%5Bkey%5D=date_short_order&‌​meta_query%5B0%5D%5B‌​value%5D=$today&‌​meta_query%5B0%5D%5B‌​compare%5D=%3C&meta_‌​query%5B0%5D%5Btype%‌​5D=DATE post_type=event&meta_query%5B0%5D%5Bkey%5D=date_short_order&‌​meta_query%5B0%5D%5B‌​value%5D=$today&‌​meta_query%5B0%5D%5B‌​compare%5D=%3C&meta_‌​query%5B0%5D%5Btype%‌​5D=DATE

Create WordPress shortcode with php code inside

Creating a shortcode is fairly simple, it only needs a shortcode name and maybe some arguments. Here is a simple one for you: add_shortcode(‘my-shortcode’,’my_shortcode_function’); function my_shortcode_function(){ return ‘<div id=”search-nacionalidad”><p class=”‘. get_field(‘nacionalidad’).’ noselect” title=”‘.get_field(‘nacionalidad’).'” alt=”‘. get_field(‘nacionalidad’).'”>’.get_field(‘nacionalidad’).'</p></div>’; } Now, using [my-shortcode] exactly does what your code does. However I’m not sure how do you use this, whether … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)