Commit 390cb447 authored by Dennis Dominik Schöpf's avatar Dennis Dominik Schöpf
Browse files

Fix folder name for assignment 4

parent 7738f6b0
<footer class="footer">© Maximilian Schmitt, Dennis Schoepf</footer>
<?php
function add_theme_scripts(){
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_script( 'script', get_template_directory_uri().'/js/main.js', array (), null, true);
}
add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
add_theme_support( 'post-thumbnails' );
<header class="header">
<h1><a href="/">CMS 2020</a></h1>
</header>
<!DOCTYPE html>
<html lang="de">
<head>
<title>CMS 2020 Theme.</title>
<?php wp_head(); ?>
</head>
<body>
<?php wp_body_open(); ?>
<?php get_header(); ?>
<section class="firstcontent">
<?php
if(have_posts()) {
the_post();
the_title();
the_content();
} else {
// No posts
}
?>
</section>
<?php if (is_front_page()) { ?>
<section>
<h2>News</h2>
<ul class="news">
<?php
$news_query = new WP_Query(array('category_name' => 'news', 'order' => 'DESC', 'posts_per_page' => 3));
if ($news_query->have_posts()) :
while ($news_query->have_posts()) : $news_query->the_post(); ?>
<li>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
</li>
<?php endwhile; else : ?>
<p>Erster Post demnächst...</p>
<?php endif;
wp_reset_postdata();
?>
</ul>
</section>
<?php }; ?>
<?php get_footer() ?>
<?php wp_footer(); ?>
</body>
</html>
console.log("Hallo Welt");
\ No newline at end of file
/*
Theme Name: CMS 2020 Theme
Author: Dennis & Max
Description: A theme for the Content Management Systems course 2020
Version: 0.1
Text Domain: minime
Tags: cms2020, minimal
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what
you've learned with others.
*/
html, body{
height: 100%;
margin: 0;
font-family: sans-serif;
}
header,section,footer{
background-color: #fafaf9;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
header, footer{
background-color: #000;
color: #fff;
}
section{
padding: 0 15px 200px 15px;
background-color: #fff;
color: #000;
}
section.firstcontent{
padding-top: 200px;
max-width: 100%;
}
.header h1 a{
color: #fff;
text-decoration: none;
}
.header{
height: 70px;
}
.footer{
height: 70px;
}
.news {
width: 100%;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
list-style-type: none;
}
.news > p {
padding: 0;
margin: 0;
}
.news > li {
flex: 1 1 0;
width: 100%;
padding: 15px;
color: #ffffff;
background-color: #000000;
border-radius: 10px;
margin-bottom: 2%;
}
.news > li > h2 > a,.news > li > h2 > a:active, .news > li > h2 > a:visited, .news > li > h2 > a:hover {
color: #fff;
}
@media (min-width: 768px) {
.news > li {
width: 30%;
}
}
......@@ -4,4 +4,5 @@ function add_theme_scripts(){
wp_enqueue_script( 'script', get_template_directory_uri().'/js/main.js', array (), null, true);
}
add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
\ No newline at end of file
add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
add_theme_support( 'post-thumbnails' );
<!DOCTYPE html>
<html lang="de">
<head>
<head>
<title>CMS 2020 Theme.</title>
<?php wp_head(); ?>
</head>
<body>
<?php wp_body_open(); ?>
<?php get_header(); ?>
<section class="firstcontent">
<?php
if(have_posts()) {
the_post();
the_title();
the_content();
} else {
// No posts
}
?>
</section>
<section>
<h2>News</h2>
<ul class="news">
<?php
$news_query = new WP_Query(array('category_name' => 'news', 'order' => 'DESC'));
if ($news_query->have_posts()) :
while ($news_query->have_posts()) : $news_query->the_post(); ?>
<li>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php the_content(); ?></p>
</li>
<?php endwhile; else : ?>
<p>Erster Post demnächst.</p>
<?php endif;
wp_reset_postdata();
?>
</ul>
</section>
<?php get_footer() ?>
<?php wp_footer(); ?>
</body>
</head>
<body>
<?php wp_body_open(); ?>
<?php get_header(); ?>
<section class="firstcontent">
<?php
if(have_posts()) {
the_post();
the_title();
the_content();
} else {
// No posts
}
?>
</section>
<?php if (is_front_page()) { ?>
<section>
<h2>News</h2>
<ul class="news">
<?php
$news_query = new WP_Query(array('category_name' => 'news', 'order' => 'DESC', 'posts_per_page' => 3));
if ($news_query->have_posts()) :
while ($news_query->have_posts()) : $news_query->the_post(); ?>
<li>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
</li>
<?php endwhile; else : ?>
<p>Erster Post demnächst...</p>
<?php endif;
wp_reset_postdata();
?>
</ul>
</section>
<?php }; ?>
<?php get_footer() ?>
<?php wp_footer(); ?>
</body>
</html>
/*
Theme Name: CMS 2020 Theme
Author: Dennis & Max
Description: A theme for the Content Management Systems course 2020
Version: 0.1
Text Domain: minime
Tags: cms2020, minimal
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what
you've learned with others.
*/
Theme Name: CMS 2020 Theme
Author: Dennis & Max
Description: A theme for the Content Management Systems course 2020
Version: 0.1
Text Domain: minime
Tags: cms2020, minimal
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what
you've learned with others.
*/
html, body{
height: 100%;
margin: 0;
font-family: sans-serif;
height: 100%;
margin: 0;
font-family: sans-serif;
}
header,section,footer{
background-color: #fafaf9;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-color: #fafaf9;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
header, footer{
background-color: #000;
color: #fff;
background-color: #000;
color: #fff;
}
section{
padding: 0 15px 200px 15px;
background-color: #fff;
color: #000;
padding: 0 15px 200px 15px;
background-color: #fff;
color: #000;
}
section.firstcontent{
padding-top: 200px;
max-width: 100%;
}
.header h1 a{
......@@ -53,6 +54,7 @@ section.firstcontent{
}
.news {
width: 100%;
margin: 0;
padding: 0;
display: flex;
......@@ -67,6 +69,7 @@ section.firstcontent{
}
.news > li {
flex: 1 1 0;
width: 100%;
padding: 15px;
color: #ffffff;
......
Markdown is supported
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