Modify loop to include all post statuses not just ‘published’

Okay, I think to start you need to change line 470 of the file includes/admin/class-learndash-admin-binary-selector.php from: ‘post_status’ => array(‘publish’), to ‘post_status’ => array(‘any’), If this doesn’t work on its own, there may be other places you need to change this as well – do a global file search on ‘post_status’ and look for places where … Read more

Trim excerpt to first paragraph

You can match this with regEx and easily choose the amount of paragraphs to return. // in context function triangle_x_excerpt( $text, $raw_excerpt ) { $content = apply_filters( ‘the_content’, get_the_content() ); $text = ( preg_match( sprintf( ‘~(<p>.+?</p>){%d}~i’, 1 ), $content, $matches ) ) ? $matches[ 0 ] : $content; return preg_replace( “/<img[^>]+\>/i”, “”, $text ); } … Read more

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