Skip to content

Instantly share code, notes, and snippets.

@dnaber-de
Last active December 12, 2015 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnaber-de/4731695 to your computer and use it in GitHub Desktop.
Save dnaber-de/4731695 to your computer and use it in GitHub Desktop.
A simple Wordpress Theme for Documentation.
<?php
get_header(); ?>
<h1>Plugin: <?php single_cat_title(); ?></h1>
<h2>Verwendet in</h2>
<ul>
<?php
while ( have_posts() ) {
the_post();
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
} ?>
</ul>
<?php
get_footer();
<?php
// nothing
<!DOCTYPE html>
<html <?php language_attributes(); ?> >
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>">
<title><?php wp_title( ' ' ); ?></title>
<?php wp_head(); ?>
<body <?php body_class(); ?>>
<?php get_header(); ?>
<h1>Seiten</h1>
<ul><?php wp_list_pages( array ( 'title_li' => FALSE ) ); ?></ul>
<?php
$posts = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'title',
'order' => 'ASC'
)
);
if ( $posts->have_posts() ) { ?>
<h1>Blogs</h1>
<ul>
<?php
while ( $posts->have_posts() ) {
$posts->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
} ?>
</ul>
<?php
}
?>
<h1>Verwendete (aktive) Plugins</h1>
<ul>
<?php
$p_counter = 0;
$plugins = get_terms(
'category',
array(
'hide_empty' => 0,
'parent' => 0
)
);
foreach ( $plugins as $p ) {
$childs = get_terms(
'category',
array(
'hide_empty' => 1,
'parent' => $p->term_id,
)
);
if ( ! empty( $childs ) || $p->count > 0 ) {
$p_counter ++;
echo '<li><a href="' . get_term_link( $p ) . '">' . $p->name . '</a></li>';
}
}
?>
</ul>
<p>Summe: <?php echo $p_counter; ?></p>
<?php
get_footer();
<?php the_post(); get_header(); ?>
<h1>Blog: <?php the_title(); ?></h1>
<h2>Plugins</h2>
<?php the_category(); ?>
<h2>Sonstiges</h2>
<?php the_content( 'more' ); ?>
<?php
get_footer();
/**
* Theme Name: Mi Mini Theme
* Description: Small theme for Documentation
* Version: 2012.02.07
* Author: David Naber
* Author URI: http://dnaber.de
* Author E-Mail: kontatk@dnaber.de
*/
body {
margin: 0;
padding: 20px 10%;
font: 1em/1.4 Georgia, serif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment