Sorting date results from a query
Modify the query_orderby clause to order by day of month. Add this to your anniversary_user_query function: $query->query_orderby = “ORDER BY DAY( $wpdb->usermeta.meta_value ) ASC”;
Modify the query_orderby clause to order by day of month. Add this to your anniversary_user_query function: $query->query_orderby = “ORDER BY DAY( $wpdb->usermeta.meta_value ) ASC”;
ah, there is a plugin that does this, but it also have some more features. Check here (plugin – WelcomeUser!)
This has to do with auto saving. You need to check the following before saving your fields: if ( ! isset( $_POST[‘action’] ) || $_POST[‘action’] != ‘editpost’ || ‘revision’ == $post->post_type ) return;
There’s no reason you can’t call add_meta_box() twice in a row and use the same function to display it both times; just change the $post_type parameter. Example foreach ( array ( ‘post’, ‘page’ ) as $post_type ) { add_meta_box( ‘your_id’, ‘your title’, ‘your_callback’, $post_type ); }
I had this same issue. I logged the request URI and discovered that the additional call was for a file that didn’t exist (that’s what I get for copying and pasting a bunch of code from one project to another). I created a file at the expected name and location, and the additional call to … Read more
There is apparently some sort of query call that takes place as part of the comments_template() call, just as there is with loop calls. When I put my custom function in the comments template, it works perfectly. I tried putting the entire contents of the comments template into my custom loop-single template, and it didn’t … Read more
I think there are multiple issues here: 1) Because you’re using query_posts() the post object’s query_vars are inherited by your new query_posts(). I suspect then, that ‘post_type’ => ‘persoane’ is implicitly part of that query posts call. If you switch to using WP_Query instead of query posts, I suspect that will fix the issue. 2) … Read more
@Rutwick’s answer was what I thought when I read the title, but I think you’re just wanting to use get_the_terms() which can be out of the loop like this: $my_post_terms = get_the_terms( $post->ID, ‘show’ ); if( $my_post_terms && !is_wp_error( $my_post_terms ) ) { // do something here with $my_post_terms array }
There’s nothing wrong with the function, it’s the fact that you aren’t actually being logged in! You say you’re making your own login form? Does this post to the standard wp-login.php, or do you handle the request yourself? Does the path/domain of the form differ from WordPress? If you inspect your cookies, are any being … Read more
There is the built in post thumbnail. WordPress will keep track of it and you can use the_post_thumbnail to display wherever needed.