Commit 38830dc2 authored by Michael Ochmann's avatar Michael Ochmann
Browse files

fixed issue, where unpublished posts where visible in the frontend

parent 2c2e5895
......@@ -57,7 +57,8 @@ class Theme {
$out = "";
$posts = wp_get_recent_posts(array(
"numberposts" => 1,
"order" => "DESC"
"order" => "DESC",
"post_status" => "publish"
), OBJECT);
$post = $posts[0];
$author = get_the_author_meta("display_name", $post->post_author);
......@@ -82,7 +83,8 @@ class Theme {
$out = array();
$posts = \wp_get_recent_posts(array(
"numberposts" => 4,
"order" => "DESC"
"order" => "DESC",
"post_status" => "publish"
), OBJECT);
array_shift($posts);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment