Time sort with meta_key using UNIX timestamp failing due to date differences

I will caveat this by saying that I am still not 100% sure I know what you are doing, but I believe the following will sort your results by time only assuming that your meta values are proper Unix timestamps. function orderby_time_only($orderby) { remove_action(‘posts_orderby’,’orderby_time_only’); return preg_replace(‘|(.*)\s(.*)|’,’DATE_FORMAT(FROM_UNIXTIME($1),”%k%i”) $2′,$orderby); } add_filter(‘posts_orderby’,’orderby_time_only’); $args = array( ‘post_type’ => ‘event’, … Read more

Separate [Advanced Custom Field] values by commas

Try to grab the output and echo together. <?php $post_objects = get_field(‘field’); if($post_objects!=”) : $value = array(); ?> <?php foreach( $post_objects as $post): ?> <?php setup_postdata($post); ?> <?php $values[] = ‘<a href=”‘. get_permalink() .'”>’. the_title(”,”,false) .'</a>’; ?> <?php endforeach; ?> <?php endif; ?> <?php wp_reset_postdata(); ?> <?php echo join( ‘, ‘, $values); ?>

use advance custom field inside query post command [closed]

When you do this: <?php query_posts(‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′); ?> The string argument is literally category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5. Well, it would be if the string were not also triggering a fatal error. What you have is (assuming I haven’t lost track of the mess): String 1: ‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′ An undefined constant: cat_1_name An out of … Read more

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