Why custom search engine only searches in post titles of custom posts?

The default WordPress search query only works on post_title and post_content fields from the wp_posts table, not including meta stored on the wp_postmeta table. It really depends on what type of search you want to perform how you could solve this, for instance, “full text”-type search, require a match on a given post meta, custom … Read more

Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?

There’s no native “Time Interval” field type in ACF, but you could: Use a third-party custom field like the “Date Range Picker” provided by ACF Extended (it’s a commercial plugin that adds features to ACF). Use 2 distinct native Date Picker fields for “from” and “to”, possibly inserted inside a Group. You may take advantage … Read more

How to detect if an ACF custom-field is really in use?

Most sensible here is probably just a custom query global $wpdb; $sql_find_meta = “SELECT post_id FROM database_name_here.wp_postmeta WHERE meta_key = ‘my_special_value’ AND meta_value > ”;”; // > ” == not null, whitespace or blank $posts_with_meta_key = $wpdb->get_col( $sql_find_meta ); foreach ( $posts_with_meta_key as etc….. You can repeat this for wp_termmeta and term_id

Generate the post title from ACF fields

The $post_id value get in save_post hook might be revision ID. So to retrieve real post ID, you can use this function wp_is_post_revision() Try to change your code as follows, function set_post_title_from_acf($post_id) { // If this is a revision, get real post ID if ( $parent_id = wp_is_post_revision( $post_id ) ) $post_id = $parent_id; $my_post … Read more

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