Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The template for displaying search results pages.
*
* @package _s
*/
get_header(); ?>
<div id="primary" class="contents-search-results">
<?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);
?>
@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
/**
* The template for displaying Search Results pages
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header();
@jchristopher
jchristopher / Moomin
Last active August 29, 2015 14:07 — forked from anonymous/Moomin
<?php
function my_searchwp_extra_metadata( $extra_meta, $post_being_indexed ) {
// index the author country
$author_country = get_field('my_countries', $post_being_indexed->post_author );
// it's stored as an array so let's get the actual text
$author_country = is_array( $author_country ) && count( $author_country ) ? implode( ' ', $author_country ) : '';
if ( ! empty ( $author_country ) ) {
$extra_meta['my_author_meta_country'] = $author_country;
<?php
/* Template Name: SearchWP Supplemental Search Engine Postcode Search */
global $post;
// retrieve our search query if applicable
$query = isset( $_REQUEST['postcode'] ) ? sanitize_text_field( $_REQUEST['postcode'] ) : '';
// if there was a space in the search, grab the first part
<?php
/**
* The template used for generating blog template Format 1 List
*
* @package WordPress
* @subpackage ASI Themes
* @since IOA Framework V1
*/
[2015-20-05 6:30:11][notice][555cc4a378e56]
[2015-20-05 6:30:11][notice][555cc4a378e56] ========== INIT 555cc4a378e56 2.5.4 ==========
[2015-20-05 6:30:11][notice][555cc4a378e56]
[2015-20-05 6:30:11][notice][555cc4a378e56] checkForMainQuery(): It is the main query
[2015-20-05 6:30:11][notice][555cc4a378e56]
[2015-20-05 6:30:11][notice][555cc4a378e56] ========== END 555cc4a378e56 ==========
[2015-20-05 6:30:11][notice][555cc4a378e56]
[2015-20-05 6:30:12][notice][555cc4a482e1d]
[2015-20-05 6:30:12][notice][555cc4a482e1d] ========== INIT 555cc4a482e1d 2.5.4 ==========
<?php
// Add to your theme's functions.php
add_filter( 'searchwp_indexed_post_types', 'my_searchwp_indexed_post_types' );
add_filter( 'searchwp_engine_settings_default', 'my_searchwp_engine_settings_default', 10, 2 );
function my_searchwp_indexed_post_types( $post_types ) {
if ( ! in_array( 'attachment', $post_types ) ) {
$post_types[] = 'attachment';
}
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);