Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode( 'wpq_index', 'mnsp_wpq_index' );
- function mnsp_wpq_index() {
- // Get the ID of the current page/post, to exclude from list
- global $post;
- $current = $post->ID;
- // Get results from Shaun's WP Query Shortcode
- global $shauns_wp_query;
- $output = '<ul class="related-pages">';
- // Begin 'The Loop'
- while( $shauns_wp_query->have_posts() ) : $shauns_wp_query->the_post();
- if( $post->ID !== $current )
- $output .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
- endwhile;
- $output .= '</ul>';
- return $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement