* Author: Nick van de Veerdonk * Author URI: https://jaaadesign.nl/ */ function amp_recent_function($atts, $append, $heading) { if (is_single() && !is_page()) { extract(shortcode_atts(array( 'append' => 'amp', 'heading' => null, 'max' => 10, ), $atts)); $return_string = ''; wp_reset_query(); return $return_string; } } function register_shortcode_amp_rec(){ add_shortcode('amp-recent-posts', 'amp_recent_function'); } add_action( 'init', 'register_shortcode_amp_rec');