ACF Field to set Publish Date – Post Duplication upon Update

Drew, one thing about your code above is that the word dateAllergy should be in quotation marks like. I’m not sure of that is the problem but it’s worth changing. $datefield = get_post_meta($post_id, ‘dateAllergy’ ,true); Also, I just noticed that your $post_id variable will be empty too. You should change that to $post->ID. That would … Read more

prevent display duplicate titles on main page

Your code should look like this to exclude duplicate titles <ul> <?php // Initial counter for displayed posts. $counter = 1; // Initial empty array of displayed titles. $titles = []; $portfolio = new WP_Query([ ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘cat’ => ” . $link1 . ”, // Because we don’t know the number … Read more

Custom product loop avoiding duplicates

Using the developers’ reference example, you are referencing $loop redundantly. Drop the $loop-> before the_post() and have_posts(): if ( have_posts() ) { $term_names = array(); while ( have_posts() ) { the_post(); $myPostID = get_the_ID(); //Uncomment next 3 lines to debug using your error log //ob_start(); //var_dump($myPostID); //error_log(‘myPostID = ‘ . ob_get_clean(),0); $arrProductTerms = wc_get_product_terms( $myPostID, … Read more

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