Add post title as alt tag for featured image

@its_me got it almost right. Those args must be 2nd resp. 3rd Parameter, not first: $attr = array( ‘title’ => ‘howdy partner’, ‘alt’ => ‘a nice view of the ocean’, ); // pick one, note 2 or 3 arguments: the_post_thumbnail( ‘post-thumbnail’, $attr ); echo(“<a href=”https://wordpress.stackexchange.com/questions/57968/$p->permalink”>”. // null for current $post->ID (use within loop) get_the_post_thumbnail( null, … Read more

Updating wp_options with an array on save_post results in duplicated entries

I had something similar going on when I tried to use the wp_editor() function while inside a custom metabox. It was wanting to save multiple times. Take a look at this. // SAVE Metabox for admin response add_action(‘post_updated’, ‘display_jwl_wp_etickets_response_meta_box_save’); function display_jwl_wp_etickets_response_meta_box_save( $post_id ){ if( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; if( !isset( $_POST[‘jwl_wp_etickets_editor_box_nonce_check’] ) … Read more

JSON not valid after json_encode posts

Newlines are not valid inside json strings. However you are outputting this code or otherwise checking it for sanity is somehow adding newlines into your long strings here. Check that your strings really are all one line and not broken up into multiple lines.

meta_query key value from array

I don’t know if you can get one array to compare to the other directly, but you can create a loop to set up a meta_query array that will check for each of the IDs within the field separately: $tag_ids = wp_get_post_tags( $post->ID, array( ‘fields’ => ‘ids’ ) ); $meta_query = array(‘relation’ => ‘OR’); foreach … Read more

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