Skip to content

Instantly share code, notes, and snippets.

View Pross's full-sized avatar
💬

Simon Prosser Pross

💬
View GitHub Profile
<script>
jQuery( document ).ready(function() {
// change the url
jQuery('.navi-left a').attr('href','http://brightldn.com/new/#home')
// add the rel
jQuery('.navi-left a').attr('rel','m_PageScroll2id')
})
</script>
function section_foot(){
if( pl_draft_mode() )
return false;
?>
<script>
jQuery(document).ready(function(){
jQuery("a[rel^='prettyPhoto']").prettyPhoto();
});
@Pross
Pross / functions.php
Created September 17, 2014 14:19
remove karma shortcode
<?php
add_action( 'after_setup_theme', 'nuke_karma' );
function nuke_karma() {
remove_shortcode( 'pl_karma' );
add_shortcode( 'pl_karma', '__return_false' );
}
diff --git a/editor/editor.typography.php b/editor/editor.typography.php
index b1ffafe..48512a8 100644
--- a/editor/editor.typography.php
+++ b/editor/editor.typography.php
@@ -39,6 +39,8 @@ class EditorTypography{
function add_google_imports(){
+ $base_url = apply_filters( 'pagelines_gfont_baseurl', '//fonts.googleapis.com/css?family=' );
+
<?php
/*
Adds following shortcodes...
[b]Im bold![/b]
[bold]So am I!![/bold]
[em]let me emphsize this![/em]
*/
<?php // you might already have this tag in functions.php
add_action( 'template_redirect', 'fix_annoying_js_plugin' );
function fix_annoying_js_plugin() {
global $pldraft;
if( is_object( $pldraft ) && $pldraft->show_editor() ) {
remove_action( 'wp_head', 'fwpcon_pro' );
}
}
@Pross
Pross / functions.php
Created October 8, 2014 22:49
Show script execution time in footer.
<?php
add_action( 'wp_footer', 'p_script_time' );
function p_script_time() {
// As of PHP 5.4.0, REQUEST_TIME_FLOAT is available in the $_SERVER superglobal array.
// It contains the timestamp of the start of the request with microsecond precision.
$time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
$time = round( $time, 2 );
$queries = get_num_queries();
echo "<div style='float:right'>Used $queries SQLs and finshed the page in $time seconds</div>";
<?php
add_action( 'wp_footer', 'add_my_tracking' );
function add_my_tracking() {
?>
<!-- Google Code for Contact Page Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 960943157;
@Pross
Pross / functions.php
Created October 19, 2014 18:30
Fix chronos in editor...
<?php
/*
Usage...
If standard chronos shortcode is [chronos] then replace word 'whatever' on L24 with chronos
If standard chronos shortcode is [chronos someoption="24"] then replace word 'whatever' on L24 with chronos someoption="24"
Then simply use [safe_chronos] for your shortcode.
@Pross
Pross / gist:586752869fa82d6598e2
Created October 29, 2014 15:49
disable animation by width
<script>
jQuery( document ).ready(function() {
var width = jQuery(window).width()
if( width < 480 ) {
var $target = jQuery('.pl-animation');
$target.removeClass('pl-animation pl-appear pla-group pl-animation-group pla-from-bottom')
}
});
</script>