This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function high_priority_style() { | |
printf( "<link rel='stylesheet' id='important-css' href='%s' type='text/css' media='all' />\n", get_stylesheet_directory_uri() . '/wp-pohja-codekit/codekit.css' ); | |
} | |
add_action('wp_head', 'high_priority_style', 8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* NOTE: 2 varibales passed here... | |
*/ | |
add_filter( 'pl-area-inner-classes', 'my_classes_filter', 10, 2 ); | |
/* | |
* Filter function now needs 2 variables | |
* 1st is the actual value being filtered | |
* 2nd is the section meta data in the form of an array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // only add this if there isnt one already, its only here to make highlighting work | |
add_filter( 'pless_vars', 'make_cdn_vars' ); | |
function make_cdn_vars( $vars ) { | |
$vars['plSectionsRoot'] = str_replace( 'www', 'cdn', $vars['plSectionsRoot'] ); | |
$vars['plRoot'] = str_replace( 'www', 'cdn', $vars['plRoot'] ); | |
$vars['plCrossRoot'] = str_replace( 'www', 'cdn', $vars['plCrossRoot'] ); | |
return $vars; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// we are going to filter navbar_logo section option on the fly.. | |
add_filter( 'pl_opt-navbar_logo', 'change_logo_on_lang' ); | |
function change_logo_on_lang( $val ) { // $val is the value of the setting. | |
// use some polylang data to get current language | |
global $curlang; | |
$curlang = $this->curlang->slug; | |
// asumming the slug is nl or en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'body_class', 'add_password_class' ); | |
function password_class( $classes ) { | |
if( post_password_required() ) { | |
$classes[] = 'password-required'; | |
} | |
return $classes; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_excerpt', 'maybe_get_the_content' ); | |
function maybe_get_the_content( $content ) { | |
global $wp_query; | |
if( $wp_query->is_home ) | |
return get_the_content(); | |
else | |
return $content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "" > spam.txt | |
for url in $(wp site list --field=url) | |
do | |
for id in $(wp --url=$url post list --field=ID) | |
do | |
printf ":" | |
content=$(wp --url=$url post get $id --field=content) | |
if [[ $content =~ .*viagra.* ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery( document ).ready(function() { | |
var width = jQuery(window).width() | |
if( width < 480 ) | |
jQuery('div').removeClass('pl-animation') | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery( document ).ready(function() { | |
jQuery('.ibox-link a').html( 'Mer <i class="icon icon-angle-right"></i>' ) | |
}) | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'after_setup_theme', 'my_add_filter' ); | |
function my_add_filter() { | |
add_filter( 'pless_vars', 'my_pless_vars' ); | |
} | |
function my_pless_vars( $vars ){ | |
$vars['plBaseFont'] = '"ff-tisa-web-pro",georgia,serif;'; | |
return $vars; |