[Plugin: WordPress Pastebin] Recent Pastes is broken – fix attached
-
Hi,
I noticed the Recent Paste widget isn’t working. Here is the simple fix.
In function loop(); on line 74 the ‘WP_Query’ array define the ‘post_type’ to be ‘paste’ but it should actually be ‘nk_paste’.
Here is the complete function with the fix applied.
function loop( $number = 5) { $my_query = new WP_Query( array( 'post_type' => 'nk_paste', 'post_status' => 'publish', 'posts_per_page' => $number, 'suppress_filters' => true ) ); if ( $my_query->have_posts() ) { echo '<ul class="loop">'; while ( $my_query->have_posts() ) { $my_query->the_post(); echo '<li><a href="' . get_permalink( get_the_ID() ) . '">'; the_title(); echo '</a></li>'; } echo '</ul>'; } else { _e( 'No pastes found', 'wordpress-pastebin' ); } }Regards, Martin.
The topic ‘[Plugin: WordPress Pastebin] Recent Pastes is broken – fix attached’ is closed to new replies.