Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_celebrities_by($atts, $content = null) {
- extract( shortcode_atts( array( 'tags' => 'None' ), $atts ) );
- $display = '';
- $args = array( 'tag_slug__and' => $tags, 'posts_per_page' => 28, 'caller_get_posts'=> 1, 'numberposts' => 1 );
- $postslist = get_posts( $args );
- if($postslist) {
- foreach($postslist as $post) {
- $display .= generate_caracters($post);
- }
- } else {
- $display .= '<p>No celebrities found.</p>';
- }
- return $display;
- }
- function generate_caracters($post) {
- $gen = '<article id="post-'.$post->ID.'" class="home-thumb">';
- $short_title = get_post_meta($post->ID, '_hollowverse-pa-data', true);
- $short_title = $short_title->short_title;
- $gen .= '<a href="'.get_permalink($post->ID).'" title=" '.get_post_meta(get_post_thumbnail_id( $post->ID ) , '_wp_attachment_image_alt', true).' " rel="bookmark">';
- $gen .= '<div class="margin-2px">'.get_the_post_thumbnail( $post->ID, 'thumbnail' ).'</div>';
- $gen .= '<h1>'.$short_title.'</h1></a>';
- $gen .= '</article><!-- #post-'.$post->ID.'-->';
- return $gen;
- }
- add_shortcode( 'group', 'get_celebrities_by' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement