Commit 04f3d851 authored by Jakob Moser's avatar Jakob Moser
Browse files

Improve page.php and single.php

parent f623505f
Loading
Loading
Loading
Loading
+21 −4
Changes for page.php: 21 added lines, 4 removed lines.
Original line number Diff line number Diff line
<?php
/*
    Theme: Fachschaft Computerlinguistik
    Page Template File
/**
 * Template for pages.
 * 
 * WordPress identifies this file by its name (which MUST be page.php)
 * and displays it whenver a single post is displayed.
 * 
 * Pages make up the scaffolding of the website and can usually be reached via
 * different menu entries. They are expected to be always correct (or else somehow archived),
 * and the author and publication date is normally irrelevant (if anything, the date of the last edit
 * might be relevant).
 * 
 * This means we neither display an author nor a date here.
 * 
 * @see https://codex.wordpress.org/Theme_Development#Pages_.28page.php.29
 */

get_header();
@@ -22,7 +33,13 @@ get_header();
			<h1 class="post-title-box"><?php echo get_the_title($post->ID); ?></h1>
		</div>
		<div class="post-content">
			<?php echo apply_filters('the_content', $post->post_content); ?>
			<?php
				if ( !post_password_required() ) {
					echo apply_filters('the_content', $post->post_content);
				} else {
					echo get_the_password_form();
				}
			?>
		</div>
		<div class="post-meta">
		</div>
+13 −7
Changes for single.php: 13 added lines, 7 removed lines.
Original line number Diff line number Diff line
<?php
/*
    Theme: Fachschaft Computerlinguistik
    Single Template File
/**
 * Template for single posts.
 * 
 * WordPress identifies this file by its name (which MUST be single.php)
 * and displays it whenver a single post is displayed.
 * 
 * Single posts display an author and a post date and are general used
 * for news articles (so a chronologically ordered list of posts makes sense,
 * you would call that a "blog").
 * 
 * @see https://codex.wordpress.org/Theme_Development#Single_Post_.28single.php.29
 */

get_header();
@@ -31,10 +39,8 @@ get_header();
			?>
		</div>
		<div class="post-meta">
			<?php
				echo '<div class="post-meta-author">'.get_the_author_meta('display_name', $post->post_author).'</div>';
				echo '<div class="post-meta-timestamp">'.get_the_date().'</div>';
				?>
			<div class="post-meta-author"><?php echo get_the_author_meta('display_name', $post->post_author);?></div>
			<div class="post-meta-timestamp"><?php echo get_the_date();?></div>
		</div>
	</article>
</main>