Skip to content

Instantly share code, notes, and snippets.

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 ginocremer/9606b80fc9258335bd4f to your computer and use it in GitHub Desktop.
Save ginocremer/9606b80fc9258335bd4f to your computer and use it in GitHub Desktop.
Praxis-Workshop: Theme-Entwicklung
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<?php the_post_thumbnail('thumbnail'); ?>
<h2><?php the_title();?></h2>
<?php the_content('Weiterlesen');
endwhile;
endif;
?>
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<h2><?php the_title();?></h2>
<?php the_content('Weiterlesen');
endwhile;
endif;
?>
<img class="header-image" src="<?php echo get_stylesheet_directory_uri(); ?>/img/header.jpg">
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css">
<title><?php bloginfo('name'); ?></title>
<h1 class="title">
<a href="<?php bloginfo('url'); ?>">
<?php bloginfo('name') ?>
</a>
</h1>
<meta name="description" content="<?php bloginfo('description'); ?>">">
/**
* Theme Name: Mein erstes WordPress-Theme
* Theme URI: http://www.pixelbar.be
* Description: Das Theme der Bäckerei Brigmann
* Version: 1.0.0
* Author: Pixelbar
* Author URI: http://www.pixelbar.be
* Tags: theme-options
*/
<?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Kopfleiste',
'description' => 'Diese Leiste wird oben auf der Website angezeigt',
'before_widget' => '<div class="kopf-item">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Rechte Leiste',
'description' => 'Diese Leiste wird rechts auf der Website angezeigt',
'before_widget' => '<div class="rechteleiste-item">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Fusszeile',
'description' => 'Diese Leiste bildet den Abschluss der Website',
'before_widget' => '<div class="footer-item">',
'after_widget' => '</div>',
'before_title' => '<h5>',
'after_title' => '</h5>'
));
}
<?php dynamic_sidebar( 'Fusszeile' ); ?>
<?php dynamic_sidebar( 'Kopfleiste' ); ?>
<?php dynamic_sidebar( 'Rechte Leiste' ); ?>
$args = array(
'width' => 1026,
'height' => 400,
'default-image' => get_stylesheet_directory_uri() . '/img/header.jpg',
);
add_theme_support( 'custom-header', $args );
<img class="header-image" src="<?php header_image(); ?>" alt="Kopfbild" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment