diff --git a/front-page.php b/front-page.php index 82c8eed..08e9e80 100644 --- a/front-page.php +++ b/front-page.php @@ -15,24 +15,7 @@
От | Публикувано на
- виж цялата новина + виж цялата новина 'sponsors', 'orderby' => 'rand' ); + $sponsors = new WP_Query( $sponsors_args ); + + if ( $sponsors->have_posts() ) : + while ( $sponsors->have_posts() ) : $sponsors->the_post(); + if ( has_post_thumbnail() ) { + $output .= the_post_thumbnail(); + } else { + $output .= get_the_title(); + } + endwhile; + endif; + + return $output; + +} + + +# Register all shortcodes +function register_shortcodes(){ + add_shortcode('sponsors', 'sponsors_shortcode'); +} + +add_action( 'init', 'register_shortcodes'); + + ?>