Skip to content

Instantly share code, notes, and snippets.

View utopicchaotica's full-sized avatar

Kat Wong utopicchaotica

View GitHub Profile
@utopicchaotica
utopicchaotica / css3-opacity-animation.css
Last active June 6, 2020 23:02
CSS3 opacity animation
.parent:hover .child {
display: block;
-webkit-animation: fadeInFromNone 0.5s ease-out;
-moz-animation: fadeInFromNone 0.5s ease-out;
-o-animation: fadeInFromNone 0.5s ease-out;
animation: fadeInFromNone 0.5s ease-out;
}
@-webkit-keyframes fadeInFromNone {
@utopicchaotica
utopicchaotica / header.php
Last active August 29, 2015 14:01
header.php (WordPress)
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html> <!--<![endif]-->
<head>
<title><?php bloginfo('name'); ?> <?php wp_title();?></title>
<meta charset="<?php bloginfo('charset'); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@utopicchaotica
utopicchaotica / wp_pagination
Created April 24, 2014 20:39
pagination script (WordPress)
if ( ! function_exists( 'the_pagination' ) ) :
function the_pagination() {
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
@utopicchaotica
utopicchaotica / style.css
Last active August 29, 2015 14:00
style.css (WordPress)
/*
Theme Name: Theme Name Here
Theme URI: http://www.blogurlhere.com
Description: Theme description here.
Version: 1
Author: Author name here
Author URI: http://www.utopicchaotica.net
*/
/* If Wordpress is 3.8, uncomment below*/
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h1 class="page-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php if (has_post_thumbnail() && is_single()) : ?>
<div class="post-thumb"><?php the_post_thumbnail(); ?></div>
<?php endif; ?>
<div class="post-content">
<?php if (is_single()) : ?>
<div class="meta">
@utopicchaotica
utopicchaotica / sidebar.php
Created April 24, 2014 19:08
sidebar.php (WordPress)
<aside class="sidebar" role="complementary">
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
<?endif; ?>
</aside>
@utopicchaotica
utopicchaotica / blog_exclude_category
Last active August 29, 2015 14:00
Exclude categories from blog and widgets (WordPress)
function blog_exclude_category( $wp_query ) {
$excluded = array('-%catID%');
// Note that this is a cleaner way to write: $wp_query->set('category__not_in', $excluded);
set_query_var( 'category__not_in', $excluded );
}
add_action( 'pre_get_posts', 'blog_exclude_category' );
function exclude_widget_categories($args){
$exclude = "%catID%"; // The IDs of the excluding categories
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
* @return void