WordPress query reverse order

Since you are using ‘post__in’ in the ‘orderby’ parameter, the ‘order’ parameter will have no effect, however, you can simply reverse the array you are passing to ‘post__in’: $args = array( ‘post_type’ => ‘etlap’, ‘posts_per_page’ => 5, ‘post__in’ => array_reverse($ids), ‘post_status’ => ‘any’, ‘orderby’ => ‘post__in’ );

Filter by field with array value in ACF on WP REST API

Advanced Custom Fields stores values for multiple select fields as a serialised Array. For a select field with options ‘one’ and ‘three’ selected, the value stored on the database would look like this: ‘a:2:{i:0;s:3:”one”;i:1;s:5:”three”;}’ It is simply not possible with WP_Query (which is where your meta query ends up) or SQL to filter results based … Read more

I’m unable to call img path using single quotes in an array?

You’re trying to use PHP tags while inside a string: ‘<img src=”https://wordpress.stackexchange.com/questions/302344/<?php bloginfo(“template_directory’); ?>/images/social/facebook-share.png” />’ You need to instead use concatenation: ‘<img src=”‘ . esc_url( get_bloginfo(‘template_directory’) ) . ‘/images/social/facebook-share.png” />’ Or my personal favorite, sprintf(): sprintf( ‘<img src=”https://wordpress.stackexchange.com/questions/302344/%1$s/images/social/facebook-share.png” />’, esc_url( get_bloginfo(‘template_directory’) ) );

Matching slug terms from one array to those in array of WP_Term objects to output term names

Perhaps array_map ? This will give you an array of term names which matched your slugs in $active_filters: $matched_terms = array_map(function($term) use ($active_filters){ if(in_array($term->slug, $active_filters)){ return $term->name; } else{ return false; } }, $tax_terms); //remove the empty array elements which came from terms which didn’t match a slug $matched_terms = array_filter($matched_terms);

Remove a link from a page ID used within an array [closed]

I have updated your code please try this and let me know if any query <div class=”row”> <?php $pages = array(54,55,56,57,58,74,75,76,77,78); $i = 1; foreach ($pages as $page) { $post_data = get_post( $page ); //print_r($post_data); $title = $post_data->post_title; $content = $post_data->post_content; $string = substr($content, 0, 0); $themeta = get_post_meta($page,true); $metalink = $themeta[0]; if (has_post_thumbnail($page) ): … Read more