Remove the first 5 characters of the_title and orderby that

WordPress WP_Query’s orderby parameter has a lot of options but nothing as specific as what you are after. I think you’d have to do this after retrieving posts through the WP_Query, then sort them using usort(). Your code should be something like this. $args = array( ‘post_type’ => ‘z_day’, ‘posts_per_page’ => -1, ‘meta_query’ => array( … Read more

Ordering posts by publish date not working?

If the given code is correct it might be the missing brackets on your pre_get_posts conditional. Let’s format it with proper indentation and spacing: function alter_query( $query ) { if( $query->is_main_query() && is_home() ) $query->set( ‘cat’, ‘2’ ); $query->set( ‘orderby’, ‘rand’ ); } add_action( ‘pre_get_posts’,’alter_query’ ); Because there’s no brackets for your conditional statement, it … Read more

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