Move Entry Meta Above Title in Archives (Genesis + Brunch Pro)
Move Entry Meta Above Title in Archives (Genesis + Brunch Pro)
Move Entry Meta Above Title in Archives (Genesis + Brunch Pro)
I cannot test this because I don’t have your code, but maybe you can get some ideas from it: add_filter( ‘wp_unique_filename’, ‘custom_image_name’, 10, 2 ); $img_id01 = media_handle_upload( ‘img_main’, $postID ); remove_filter( ‘wp_unique_filename’, ‘custom_image_name’, 10, 2 ); function custom_image_name( $filename, $ext ) { global $postID; $post = get_post( $postID ); return $filename . ‘-‘ . … Read more
The reason for that is the save_post loop. When you call wp_insert_post, it triggers save_post and thus inserts the student meta. what you can do is, to check if the post type is correct while inserting the meta. like: add_action( ‘save_post’, ‘save_student_meta’, 10, 2 ); function save_student_meta( $post_id, $post ) { if ( ‘student’ !== … Read more
It depends how and where you use this string. Possibly, you have to localize the date according to the site settings: <?php $date_format = get_option( ‘date_format’ ); $timestamp = strtotime( get_the_time() ); $localized_date = date_i18n( $date_format, $timestamp );
Get post content before rendering
You can use this function, which you’d add to the theme’s functions.php file, to update the average post rating which is saved in a private meta named _avg_rating (but you can of course rename it) — private meta has their name starting with an underscore (_): function update_post_avg_rating( $comment_id, $post_id = 0 ) { if … Read more
Attachment metadata has value of ‘1’
Export media library with metadata and import into new blog
The default way WordPress separates different types of meta data, such as in the post meta data, is using a pipe |. For example, Author Name | Date | Cat1, cat2, cat3 This isn’t correct. WordPress doesn’t have a default way that it displays this information. It’s entirely up to the theme developer. if you’d … Read more
Display multiple meta_key/meta_values by single SQL query