Skip to content

Instantly share code, notes, and snippets.

Simon Prosser Pross

Block or report user

Report or block Pross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Fix Icons
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)
}
})
View gist:9254063
<?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');
View gist:9262487
$.ResizeCanvasVids = {
init: function(){
$.ResizeCanvasVids.checkLoop()
}
, checkLoop: function(){
$('.bg-video').each( function(){
var video = this
$(video).hide()
View gist:9396483
class PageLines_ShortCodes {
function __construct() {
self::register_shortcodes( $this->shortcodes_core() );
// Make widgets process shortcodes
add_filter( 'widget_text', 'do_shortcode' );
View random.php
<?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 Apr 4, 2014
Remove thumbnail from single posts
View functions.php
<?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);
View test.js
<script>
jQuery(function(){
if(navigator.userAgent.match(/(iPhone|Android.*Mobile)/i))
{
jQuery('.mainlogo-link').prop('href', 'tel:12148560425')
}
})
</script>
View functions.php
add_action('wp_enqueue_scripts', 'deregister_pl_fitvids', 100);
function deregister_pl_fitvids() {
wp_dequeue_script('pagelines-fitvids');
wp_dequeue_style('open-sans');
}
View functions.php
<?php
add_action( 'template_redirect', 'fix_ellens_mess', 9 );
function fix_ellens_mess() {
if( ! is_feed() )
return;
else
define( 'WP_STAGE', 'staging' );
}
View gist:b1505767bab02dc15f8d
.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,
You can’t perform that action at this time.