XMLRPC pingback.extensions.getPingbacks not work with parameters

Note that WordPress ships with WP_HTTP_IXR_CLIENT that extends the IXR_Client. So replace require_once ABSPATH . WPINC . ‘/class-IXR.php’; $rpc = new IXR_Client( ‘http://localhost/wordpress/wordpress/xmlrpc.php’ ); with: require_once ABSPATH . WPINC . ‘/class-IXR.php’; require_once ABSPATH . WPINC . ‘/class-wp-http-ixr-client.php’; $rpc = new WP_HTTP_IXR_CLIENT( ‘http://localhost/wordpress/wordpress/xmlrpc.php’ ); Then try replacing: $result = $rpc->query( ‘pingback.extensions.getPingbacks’, ‘http://localhost/wordpress/wordpress/2018/01/17/hallo-welt/&post_type=something’ ); with $result = … Read more

Show posts from categories instead of tags

In the function wp_get_post_terms() you can select the taxonomy. the default is post_tag you can change it to category. And in the WP_Query args you need to change the tag__in to category__in. // get the categories $categories = wp_get_post_terms($post->ID, ‘category’); if ($categories) { $categories_ids = array(); foreach($categories as $individual_cat) $categories_ids[] = $individual_cat->term_id; $args=array( ‘category__in’ => … Read more

Wp_query ordering problem

From what I understand the $productArrayShop is array of all the products ids. So you first don’t need all the distances. what the point to get the distances? You just need all the products IDs and to order them by the meta_value. BTW this order should be in the first loop instead of re-query for … Read more

WP_Query: custom orderby (not ASC nor DESC)

You probably can find some way to make MySQL do the sort for you, but an alternative approach is to make it into an ASC/DESC order by adding additional meta in which you put a numeric sort order value based on whether it is apple, bag, etc and update it when the post is saved. … Read more

Filtering ‘Featured’ posts from a batch of category IDs

Follow the example code below, if you are using WordPress default post. For custom post type the query will be different. <?php $args = array( ‘category_name’ => ‘parent_category_slug+featured_category_slug’, // change the category slug as your own ); $query = new WP_Query($args); if($query->have_posts()): while($query->have_posts()): $query->the_post(); ?> <h4><?php the_title(); ?></h4> <?php endwhile; // main loop wp_reset_postdata(); endif; … Read more

Display 3 levels of categories on page

Try this: <?php $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var(‘paged’) : 1; $cat_id = 42; $child_categories=get_categories( array( ‘parent’ => $cat_id ) ); foreach ( $child_categories as $child ) { ?> <!– loop through child categories and make columns –> <div class=”col-sm-4″> <!– category title –> <?php $string = $child->cat_name; $className = str_replace(‘ ‘, … Read more