Seach custom post type posts only by meta fields?

This might work, not tested though. First add this to join the postmeta table: add_filter( ‘posts_join’, ‘search_filters_join’, 501, 2 ); function search_filters_join( $join, $query ) { global $wpdb; if ( empty( $query->query_vars[ ‘post_type’ ] ) || $query->query_vars[ ‘post_type’ ] !== ‘product’ ) { return $join; // skip processing } if ( ($this->is_ajax_search() || $this->is_search_page()) && … Read more

How to extract specific post

As noted in the documentation meta_value, when not used inside a meta query, needs to be a string. Normally if you want to query based on multiple meta values you need to add a meta_query argument. But also as noted in the documentation regarding value: It can be an array only when compare is ‘IN’, … Read more

How to change image atributes right before an image to be saved?

If the import function you’re using uses wp_insert_post() (used also by wp_insert_attachment()) to add the new images (attachment posts) to your site, then you could perhaps use the wp_insert_attachment_data( array $data, array $postarr ) filter, which is defined inside wp_insert_post(). According to the docs it, Filters attachment post data before it is updated in or … Read more

OG Meta Tags not being scraped by facebook or twitter

Pop your website into the facebook debugger. https://developers.facebook.com/tools/debug/sharing/ This will do 2 things: Flush the cached version of your site Facebook has stored. Tell you any problems with sharing data that may prevent those OG tags being used. In the event of no errors and cache refreshed, you can then share your link again and … Read more

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