Skip to content

Instantly share code, notes, and snippets.

@alexadark
alexadark / Functions.php
Created November 9, 2013 10:19 — forked from barbwiredmedia/Functions.php
Wordpress: breadcrumbs
//Bread crumbs created
function wordpress_breadcrumbs() {
$delimiter = '|';
$currentBefore = '<span class="current">';
$currentAfter = '</span>';
if ( !is_home() && !is_front_page() || is_paged() ) {
echo '<div id="crumbs">';
global $post;
if ( is_page() && !$post->post_parent ) {
echo $currentBefore;
@alexadark
alexadark / gist:7384112
Created November 9, 2013 10:32
Wordpress: loop
<?php if(have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; else: ?>
<p>There are no posts or page here</p>
<?php endif; ?>
@alexadark
alexadark / theloop
Created November 9, 2013 16:49
WP: loop
<?php get_header(); ?>
<?php if (have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php the_content( ); ?>
<hr>
<?php endwhile; else: ?>
@alexadark
alexadark / theme.js
Created November 11, 2013 06:25
jquery: ready
jQuery(document.ready(function($)) {
$('flexslider').flexslider();
}
@alexadark
alexadark / jquery
Created February 20, 2014 16:57
jquery:sticky footer2
function jqUpdateSize(){
// Get the dimensions of the viewport
var width = jQuery(window).width();
var height = jQuery(window).height();
// jQuery('#jqWidth').html(width); // Display the width
jQuery('.bodywrapper').css('height',height-45); // Set the height
};
jQuery(document).ready(jqUpdateSize); // When the page first loads
jQuery(window).resize(jqUpdateSize); // When the browser changes size
@alexadark
alexadark / gist:9446082
Created March 9, 2014 11:00
genesis center logo
//* Remove the header right widget area in functions.php
unregister_sidebar( 'header-right' );
css:
.header-image .title-area, .header-image .site-title, .header-image .site-title a, .header-image .site-header .wrap .title-area {
float:none;
margin: 0 auto;
}
@alexadark
alexadark / gist:9448416
Created March 9, 2014 14:17
genesis DWB: enqueue scripts
add_action( 'wp_enqueue_scripts', 'enqueue_dev_style' );
/**
* Enqueue development css file which will be in uploads > themes > dynamik/gen root folder.
*/
function enqueue_dev_style()
{
wp_enqueue_script( 'dev', dynamik_get_stylesheet_location( 'url' ) . 'dev.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_enqueue_style( 'dev', dynamik_get_stylesheet_location( 'url' ) . 'dev.css', CHILD_THEME_VERSION, true );
}
@alexadark
alexadark / gist:9482072
Created March 11, 2014 09:07
css animation: morp
.morph1 {
background: url(/wp-content/uploads/2014/01/but-webdesign-01.png);
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.morph1:hover {
@alexadark
alexadark / ribbon
Created March 22, 2014 17:17
CSS: ribbon bg
.sidebar .widget-title:before {
border-bottom: 15px solid #005D87;
border-left: 20px solid rgba(0, 0, 0, 0);
content: "";
display: block;
height: 0;
left: 0;
position: absolute;
top: -15px;
width: 0;
@alexadark
alexadark / simple social icons turning
Created March 24, 2014 21:28
css: simple social icons
.simple-social-icons li a {
-webkit-transition: -webkit-transform 0.4s ease-out;
-moz-transition: -moz-transform 0.4s ease-out;
transition: transform 0.4s ease-out;
}
.simple-social-icons li a:hover {
-webkit-transform: rotateZ(360deg);
-moz-transform: rotateZ(360deg);
transform: rotateZ(360deg);