Can the_post_navigation() be outside of the loop?

Yes, the_post_navigation() works outside of the loop on single post views. Following the function calls, the_post_navigation() uses get_the_post_navigation() which uses get_previous_post_link() and get_next_post_link() which use get_adjacent_post_link() which finally uses get_post() which defaults to the global $post object. Here’s an excerpt of get_adjacent_post_link(): function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $previous = true, $taxonomy = … Read more

Not display post meta if empty

Use in this way- <strong> <?php $duration_in_seconds = get_post_meta( get_the_ID(), ‘wpscript_duration’, true ); if( ” != $duration_in_seconds && 0 != $duration_in_seconds ) { $minutes = floor($duration_in_seconds / 60); $seconds = $duration_in_seconds – (60 * $minutes); echo $minutes; echo ” MIN”; } ?> </strong>

How to sort posts in admin by name

As u put a screenshot from admin in your question I assume you are trying to sort the order from posts within admin area. Besides, u didn’t say anything about whether u want to change the order of the posts for good or u want just to see your posts in a certain order temporarily. … Read more