diff --git a/helper.php b/helper.php deleted file mode 100644 index 718b612..0000000 --- a/helper.php +++ /dev/null @@ -1,28 +0,0 @@ - 0) { - return $posts; - } else { - return []; - } -} - -/** - * Get all menus - */ -function menus() { - global $menus; - - if (isset($menus) && count($menus) > 0) { - return $menus; - } else { - return []; - } -} \ No newline at end of file diff --git a/index.php b/index.php index 7b0ff42..5e8275e 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,6 @@ @@ -63,16 +64,7 @@ @@ -83,31 +75,7 @@
- -
- -

- -

-
-
-
-

- -

-
-
-
- +
diff --git a/menuHelper.php b/menuHelper.php new file mode 100644 index 0000000..1512f5f --- /dev/null +++ b/menuHelper.php @@ -0,0 +1,27 @@ + 0) { + foreach ($menus as $menu) { + $allMenus .= createEachMenuItem($menu); + } + } + return $allMenus; +} + +function createEachMenuItem($menu){ + $menuBody = "\n"; + return $menuBody; + +} diff --git a/postHelper.php b/postHelper.php new file mode 100644 index 0000000..a41ecff --- /dev/null +++ b/postHelper.php @@ -0,0 +1,34 @@ + 0) { + foreach ($posts as $post) { + $allPosts .= createEachPost($post); + } + } + return $allPosts; +} + + +function createEachPost($post){ + + $postBody = '
'; + $postBody .= ''; + $postBody .= '

'.$post['title'].'

'; + $postBody .= '
'; + $postBody .= '
'; + $postBody .= '
'; + $postBody .= '

'.$post['intro'].'

'; + $postBody .= '
'; + $postBody .= '
'; + $postBody .= '
'; + return $postBody; +} \ No newline at end of file