How to sort posts according to meta value?

‘meta_key=keyname’ must also be present in the query so I think you’d want $args = array( ‘meta_query’ => array( array( ‘key’ => ‘wpcf-stream’, ‘value’ => $_POST[‘category’], ‘compare’ => ‘=’ ) ), ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘wpcf-stream’, ‘post_type’ => ‘half-day-course’, ‘posts_per_page’ => 100, ‘order’ => ‘ASC’ ); to display the rest of the posts I’d … Read more

WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page

This is the finally code that is working like a chram <?php $taxonomy = get_taxonomy( get_queried_object()->taxonomy ); $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); get_header(); ?> <h1 class=”page-title”>Θέσεις εργασίας για <?php echo $term->name; ?></h1> <div id=”content”> <article id=”post-<?php the_ID(); ?>” <?php post_class(‘post’); ?>> <?php echo do_shortcode(‘[jobs categories=”.get_query_var(“job_listing_category’).’ show_filters=”true”]’); ?> </article> </div> … Read more

Output dynamic_sidebar_params in wp_head

Going through its normal proceedings WordPress will already have evaluated wp_head by the time it gets to the widgets. The dynamic_sidebar_params filter will only be called then as well, so it will also be of little help to get your css in the head. Here‘s something I wrote about this issue earlier. To include information … Read more

How to apply a filter to everything?

There is no “filter everything” function. WordPress does something with their capital_P_dangit() function that attaches to ‘the_title’, ‘the_content’, and ‘comment_text’. https://developer.wordpress.org/reference/functions/capital_p_dangit/

Change url to posts if they have custom tax only

It works for me. add_filter(‘post_link’, ‘locale_permalink’, 10, 3); add_filter(‘post_type_link’, ‘locale_permalink’, 10, 3); function locale_permalink($permalink, $post_id, $leavename) { if (strpos($permalink, ‘%category_slider%’) === FALSE) return $permalink; $post = get_post($post_id); if (!$post) return $permalink; if ($post->post_type != ‘post’) { return $permalink; } else { $terms = wp_get_object_terms($post->ID, ‘category_slider’); if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug; else … Read more

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