Elementor #6103

				
					<?php
// Hent innlegg publisert p&aring; dagens dato
$args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'posts_per_page' => 1,
  'date_query' => array(
    array(
      'year' => date('Y'),
      'month' => date('m'),
      'day' => date('d')
    )
  )
);
$posts = get_posts($args);

// Vis innlegg hvis det finnes
if ( $posts ) {
  foreach ( $posts as $post ) {
    setup_postdata( $post );
    ?>
    <h2><?php the_title(); ?></h2>
    <div><?php the_content(); ?></div>
    <?php
  }
  wp_reset_postdata();
} else {
  echo 'Ingen innlegg funnet.';
}
?>