Generate list of posts on a page, but fill shortcode values from ACF fields on that page

I have actually found a really elegant solution to this myself. The issue is not with the [random-posts-list], it is with the script used to generate the [county] shortcode. Instead of using $post_ID = get_the_ID(); I should have been using $post_ID = get_queried_object_id();. This is a built-in WordPress query. With the above amend, I also … Read more

ACF Custom post type name changing issue

The answer to this should be rather simple. Please visit the settings page with the url settings. Just visit it. yoursite.com/wp-admin/options-permalink.php By doing so, WordPress should trigger the “Flush-Rewrite” hook, which creates a new .htaccess with the appropriate rules. However, please also be aware that depending on your custom-post-type some hooks in your code might … Read more

Draft standard post by ACF Data picker

This code works perfectly! function delete_expired_posts() { $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘fecha_borrado’, ‘compare’ => ‘EXISTS’, ), ), ‘posts_per_page’ => -1, ); $query = new WP_Query($args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $post_id = get_the_ID(); $acf_date = get_field(‘fecha_borrado’, $post_id); $acf_timestamp = strtotime($acf_date); $current_timestamp = time(); if ($acf_timestamp … Read more

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