Skip to content

Instantly share code, notes, and snippets.

View Pross's full-sized avatar
💬

Simon Prosser Pross

💬
View GitHub Profile
@Pross
Pross / Fix Icons
Last active August 29, 2015 13:56
jQuery( "i" ).each(function( e ) {
var classes = jQuery(this).attr('class') || ''
var check = classes.indexOf("icon-");
if( -1 != check ) {
jQuery(this).attr('class', 'icon ' + classes)
}
})
<?php
function SearchFilter($query) {
if ($query->is_search) {
$query->set( 'post__not_in' , array( 165 ) ); // Page ID
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
$.ResizeCanvasVids = {
init: function(){
$.ResizeCanvasVids.checkLoop()
}
, checkLoop: function(){
$('.bg-video').each( function(){
var video = this
$(video).hide()
class PageLines_ShortCodes {
function __construct() {
self::register_shortcodes( $this->shortcodes_core() );
// Make widgets process shortcodes
add_filter( 'widget_text', 'do_shortcode' );
<?php
add_action( 'wp_head', 'pagelines_google_author_head' );
function pagelines_google_author_head() {
global $post;
if( ! is_page() && ! is_single() && ! is_author() )
return;
$google_profile = get_the_author_meta( 'google_profile', $post->post_author );
@Pross
Pross / functions.php
Created April 4, 2014 22:46
Remove thumbnail from single posts
<?php
function remove_post_thumbnail($metadata, $object_id, $meta_key, $single){
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() )
return false;
else
return $metadata;
}
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4);
@Pross
Pross / test.js
Last active August 29, 2015 14:00
<script>
jQuery(function(){
if(navigator.userAgent.match(/(iPhone|Android.*Mobile)/i))
{
jQuery('.mainlogo-link').prop('href', 'tel:12148560425')
}
})
</script>
add_action('wp_enqueue_scripts', 'deregister_pl_fitvids', 100);
function deregister_pl_fitvids() {
wp_dequeue_script('pagelines-fitvids');
wp_dequeue_style('open-sans');
}
<?php
add_action( 'template_redirect', 'fix_ellens_mess', 9 );
function fix_ellens_mess() {
if( ! is_feed() )
return;
else
define( 'WP_STAGE', 'staging' );
}
.pl-section-controls,
.pl-region-bar,
.pl-area-controls,
.pl-column-forcer,
.pl-sortable-buffer,
.li-refresh,
.pl-editor-only,
.linked-tpl,
.linked-section,
.area-unlock,