WP_Query ordering numbers as letters

To evaluate a meta value as a number, use meta_value_num. Try: $args = array( “fields” => “ids”, “meta_key” => “jogador_oficial”, “meta_value” => true, “meta_query” => array( “relation” => “AND”, “query_one” => array( “key” => “quantidade_corretas” “orderby” => “meta_value_num”, “order” => “DESC” ), “query_two” => array( “key” => “tempo_total” “orderby” => “meta_value_num”, “order” => “ASC” ), … Read more

ACF: Only get first row of a Repeater Field

ACF has a function called get_row_index() that you can utilize. Here is how you can possibly use it in your case <?php $active=”active”; while ( have_rows(‘images’) ) : the_row(); $image = get_sub_field(‘image’); if(get_row_index() == ‘1’ ): ?> <img src=”<?php echo get_template_directory_uri(); ?>/files/images/<? php the_sub_field(‘image’); ?>” class=”img-fluid is-slider-item” /> break; <?php $active=””; endwhile; ?> <?php endif; … Read more

Faking the “onSave” event

Have you seen wpshell? It’s a command line tool for wordpress. Basically, it’s a WordPress environment that lets you run arbitrary php – so you could set up a WP_Query that pulls all posts, loop through them, and fire that command on each one. Sort of what I had in mind, untested. Using wp_update_post() as … Read more

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