Skip to content

Instantly share code, notes, and snippets.

@kisabelle
kisabelle / grid.css
Created March 16, 2012 16:44
CSS Grid Framework
.container{
display: block;
margin: 0 auto;
width: 974px;
}
.column{
float: left;
margin-right: 10px;
}
@kisabelle
kisabelle / jquery-scroll-to-element-with-easing.js
Last active December 27, 2015 02:49
jQuery Scroll to Element with Easing / Smooth Scrolling, Reveal "Back to Top" link on scroll down
// method 1
$(function() {
$('nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
@kisabelle
kisabelle / pinterest-img-tag-wordpress-filter.php
Last active January 1, 2016 18:58
Filter the_content() to add Pinterest button code, by Jan Dembowski.
<?php
/*
Plugin Name: Pinterest Img Tag Button
Description: This will wrap images in the_content with Pinterest Button code
Author: Jan Dembowski
Author URI: http://blog.dembowski.net/
Version: 0.5
From http://wordpress.org/support/topic/add-code-before-each-image
@kisabelle
kisabelle / copyright-widget.php
Created December 30, 2013 20:23
A very simple custom Wordpress widget.
@kisabelle
kisabelle / clearfix.css
Created January 16, 2014 23:07
Micro clearfix by Nicolas Gallagher
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}
@kisabelle
kisabelle / acf.php
Last active March 26, 2021 13:42
Advanced Custom Fields
/*----------------------------------------------*/
/* Image Field
/*----------------------------------------------*/
/* Return value: Attachment ID */
<?php if(get_field('logo')): ?>
<?php
$attachment_id = get_field('logo');
$size = "vendor-logo"; // (thumbnail, medium, large, full or custom size)
@kisabelle
kisabelle / updated-wp-search-custom-fields.php
Last active April 19, 2017 20:10
Search Custom Fields: Include Custom Fields in Wordpress Search
// .dP"Y8 888888 db 88""Yb dP""b8 88 88
// `Ybo." 88__ dPYb 88__dP dP `" 88 88
// o.`Y8b 88"" dP__Yb 88"Yb Yb 888888
// 8bodP' 888888 dP""""Yb 88 Yb YboodP 88 88
// dP""b8 88 88 .dP"Y8 888888 dP"Yb 8b d8 888888 88 888888 88 8888b. .dP"Y8
// dP `" 88 88 `Ybo." 88 dP Yb 88b d88 88__ 88 88__ 88 8I Yb `Ybo."
// Yb Y8 8P o.`Y8b 88 Yb dP 88YbdP88 88"" 88 88"" 88 .o 8I dY o.`Y8b
// YboodP `YbodP' 8bodP' 88 YbodP 88 YY 88 88 88 888888 88ood8 8888Y" 8bodP'
@kisabelle
kisabelle / wp-insert-post-data.php
Last active January 3, 2016 15:29
Append post meta to the content (post_content) (uses 'wp_insert_post_data')
<?php
//----------------------------------------------
// Filter Post Data
//----------------------------------------------
/* The purpose of this filter is to take the
/* post meta from a custom field and save it
/* into post_content */
// Tack our filter onto the wp_insert_post_data action
@kisabelle
kisabelle / wp-custom-post-pagination.php
Created January 17, 2014 23:30
Pagination with Custom Post Types in WordPress
<?php
//setup new query
$query = new WP_query(
array(
'posts_per_page' => 10, // ??
'post_type' => 'custom-post-type', // custom post type
'paged' => get_query_var('paged'),
'meta_key' => 'wpcf-meta-key',
'orderby' => 'meta_value title',
@kisabelle
kisabelle / wp-child-page-template.php
Created January 22, 2014 18:36
Wordpress Child Page Template
There is no specific template for child pages, but you can do this pretty easily with the get_template_part() function.
First create a file called "content-child.php".
Second create a file called "content.php".
Next, inside of page.php, place this:
<?php
if( $post->post_parent !== 0 ) {