Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The template for displaying Search Results pages
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header();
@jchristopher
jchristopher / 0_reuse_code.js
Created May 28, 2014 20:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php get_header(); ?>
<?php
$number_of_feature_posts = 1;
$number_of_secondary_posts = 8;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$how_many_secondary_posts_past = ($number_of_secondary_posts * ($paged - 1));
$off = $number_of_feature_posts + (($paged > 1) ? $how_many_secondary_posts_past : 0);
?>
<?php
/**
* The template for displaying Search Results pages.
*
* @since alterna 1.0
*/
get_header(); ?>
<?php
jQuery(document).ready(function($){
if(location.hash){
if($(location.hash)){
setTimeout(function(){
var targetTop = $('#content').offset().top;
targetTop -= $('#header').height() + $('#nav').height() - 23;
$('body,html').scrollTop(targetTop);