how show post date for specific post?
Assuming you know the post ID for the specific post/type it’s easy enough yes, simply call get_the_date() with a specific ID. Adjust 1 to the appropriate value. <?php echo get_the_date( ”, 1 ); ?>
Assuming you know the post ID for the specific post/type it’s easy enough yes, simply call get_the_date() with a specific ID. Adjust 1 to the appropriate value. <?php echo get_the_date( ”, 1 ); ?>
Export Posts Without Categories In An XML File
Word count for all posts of all authors
NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)
Is there a block to print post link standalone in a block theme?
Add custom PHP (no-SQL) filter to WP_query
Thanks to @cameronjonesweb’s link, here’s the code you might use: add_filter( ‘manage_edit-post_sortable_columns’, ‘my_add_sortable_custom_column’); function my_add_sortable_custom_column( $columns ) { $columns[‘views’] = ‘views’; return $columns; } add_action( ‘pre_get_posts’, ‘my_sort_custom_column’ ); function my_sort_custom_column( $query ) { if( ! is_admin() || ! $query->is_main_query() ) { return; } if ( ‘views’ === $query->get( ‘orderby’) ) { $query->set( ‘orderby’, ‘meta_value’ ); … Read more
Most sensible here is probably just a custom query global $wpdb; $sql_find_meta = “SELECT post_id FROM database_name_here.wp_postmeta WHERE meta_key = ‘my_special_value’ AND meta_value > ”;”; // > ” == not null, whitespace or blank $posts_with_meta_key = $wpdb->get_col( $sql_find_meta ); foreach ( $posts_with_meta_key as etc….. You can repeat this for wp_termmeta and term_id
Got it – update_post_meta has to be used for _wp_attachment_image_alt
Resolved! If no feature image exists, then _embedded[‘wp:featuredmedia’] is not used. To resolve, the prop value needs to be wrapped into a conditional. <Post key={post?.id} id={post?.id} title = {post?.title.rendered} link = {post?.link} img = {post && post._embedded && post._embedded[‘wp:featuredmedia’] ? post._embedded[‘wp:featuredmedia’][0].source_url : ‘ ‘ } category = {post?.categories} />