get all posts in custom post type by ACF field value

Meta Queries are nested arrays. See the WP_Query section on meta queries. Option 1 Use meta_key and meta_value directly in the query arguments, not as a meta query. $student_query_args = [ ‘post_type’ => ‘student_list’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 100, ‘order’ => ‘DESC’, ‘meta_key’ => ‘program_id’, ‘meta_value’ => 5317, ]; Option 2 The meta query … Read more

How to break a date from ACF?

Here you can get separated data from timestamp using date(); function. you can apply different fonts each value. <?php $timestamp = get_field(‘date_time’); $day = date(‘d’, $timestamp); $mon = date(‘m’, $timestamp); $year = date(‘Y’, $timestamp); echo “Day : “.$day.”<br>”; echo “Month : “.$mon.”<br>”; echo “Year : “.$year; ?> if $timestamp value “1567503270” then output will be … Read more

How to make Advanced Forms (and/or ACF) encode input value?

I believe you need the af/email/before_send hook. I found this solution here: https://gist.github.com/mishterk/70bb486baac349c29b684346b77826ce Rather than permanently modifying the email saved with the form entry, you can simply modify the message field to encode the email. For example: <?php // Set the form key you wish to target $form_key = ‘form_5d97cf9edc0a8’; add_action( “af/email/before_send/key=$form_key”, function ( $email, … Read more

How to decrease the number of queries with get_posts and ACF?

It’s everything OK with get_posts() since it creates the single WP_Query instance per call. You can check the query by creating that instance: <?php $test_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, // any number, does not matter ‘post__in’ => $ids, // should be an array! ) ); echo $test_query->request; Adding ‘meta_query’ … Read more

Remove headings option from Wysiwyg editor from ACF in a certain custom post type

You can generally edit the capability of the tinyMCE WYSIWYG Editor for ACF with the acf/fields/wysiwyg/toolbars hook. By default the WYSIWYG editor has two toolbars, “Full” and “Basic” but you can also create you own(see docs) Removing the formatting option for the “Full” WYSIWYG editor can be accomplished like this: add_filter( ‘acf/fields/wysiwyg/toolbars’ , ‘my_toolbars’ ); … Read more

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