Skip to content

Instantly share code, notes, and snippets.

View seoagentur-hamburg's full-sized avatar

Andreas Hecht seoagentur-hamburg

View GitHub Profile
@seoagentur-hamburg
seoagentur-hamburg / autor.php
Last active August 29, 2015 14:18
Der nötige Code für die Anzeige der Autorenbox
<?php
/**
* Die Biobox für jeden Autor der Website
*
*/
?>
<div class="author-info">
<?php echo get_avatar( get_the_author_meta('email'), '60' ); ?>
<div class="author-description">
<h3><?php echo _e('Autor: ', 'revothemes');
@seoagentur-hamburg
seoagentur-hamburg / author.css
Created April 10, 2015 16:47
Das nötige CSS für unsere Autorenseite
/* Der Hintergrund unserer Autorenbox und der Überschrift
---------------------------------------------------------------------------------------- */
.user-info {
background-color: #fff;
border-top: 1px solid rgba(51, 51, 51, 0.1);
padding: 5% 7.6923% 3.84615% 7.6923%;
margin: 0 8.3333%;
margin-bottom: 8.3333%;
}
@seoagentur-hamburg
seoagentur-hamburg / sitemap-1.php
Created April 11, 2015 11:00
Teil 2 des Sitemap Templates
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Der Titel der WordPress-Seite -->
<header class="entry-header">
<?php
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
endif;
@seoagentur-hamburg
seoagentur-hamburg / non-www-to-www.txt
Created April 13, 2015 11:37
301 Redirect von nicht www auf www
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
@seoagentur-hamburg
seoagentur-hamburg / www-to-non-www.htaccess
Created April 13, 2015 11:31
301 Redirect von www auf nicht www
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
@seoagentur-hamburg
seoagentur-hamburg / gist:5379190
Created April 13, 2013 16:58
HTML for fullpage background image, insert right after <body>.
<body>
<div>
<img id="background-img" src="fluss.jpg" alt="" /> <!-- Das eingebundene Hintergrundbild -->
<div>
<!-- Der Inhalt der Seite folgt hier -->
</body>
@seoagentur-hamburg
seoagentur-hamburg / gist:5397697
Created April 16, 2013 17:14
Die richtige Art, um is_front_page() und is_home() korrekt zu nutzen.
<?php
if ( is_front_page() && is_home() ){
// Default homepage
} elseif ( is_front_page()){
//Static homepage
} elseif ( is_home()){
//Blog page
} else {
//everything else
@seoagentur-hamburg
seoagentur-hamburg / gist:5413038
Last active December 16, 2015 09:29
Das CSS für das vollflächige Hintergrundbild Teil 2
#bg {
position: fixed;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
}
#bg img {
position: absolute;
top: 0;
@seoagentur-hamburg
seoagentur-hamburg / gist:5413240
Created April 18, 2013 14:38
Das jQuery für die Lösung vollflächige Hintergrundbilder 3
$(window).load(function() {
var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width() / $bg.height();
function resizeBg() {
if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
$bg
@seoagentur-hamburg
seoagentur-hamburg / gist:5413219
Created April 18, 2013 14:36
CSS für vollflächige Hintergrundbilder mit jQuery
#bg { position: fixed; top: 0; left: 0; }
.bgwidth { width: 100%; }
.bgheight { height: 100%; }