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 | |
$handle = fopen("style.css", "r"); | |
$file = 'config.json'; | |
$arr = array(); | |
if ($handle) { | |
$key = ''; | |
while (($line = fgets($handle)) !== false) { | |
preg_match('/[\w-]+/', $line, $matches ); |
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 | |
//Register tag cloud filter callback | |
add_filter('widget_tag_cloud_args', 'tag_widget_limit'); | |
//Limit number of tags inside widget | |
function tag_widget_limit($args){ | |
//Check if taxonomy option inside widget is set to tags | |
if(isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag'){ |
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 | |
if( defined('YITH_WCAS_PREMIUM') ){ | |
global $yith_wcas; | |
add_filter( 'ywrac_results', 'ywrac_custom_result', 10, 2 ); | |
remove_action( 'pre_get_posts', array( $yith_wcas, 'pre_get_posts' ) ); | |
} | |
function ywrac_custom_result( $posts, $search_keyword ){ | |
global $woocommerce; | |
$ordering_args = $woocommerce->query->get_catalog_ordering_args( 'title', 'asc' ); |
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
mkdir $BRANCH | |
cd $BRANCH | |
git init | |
git remote add -t $BRANCH -f origin $REMOTE_REPO | |
git checkout $BRANCH | |
oppure | |
mkdir newrepo.git | |
cd newrepo.git | |
git init |
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
Date.prototype.format = function(format) { | |
var returnStr = ''; | |
var replace = Date.replaceChars; | |
for (var i = 0; i < format.length; i++) { var curChar = format.charAt(i); if (i - 1 >= 0 && format.charAt(i - 1) == "\\") { | |
returnStr += curChar; | |
} | |
else if (replace[curChar]) { | |
returnStr += replace[curChar].call(this); | |
} else if (curChar != "\\"){ | |
returnStr += curChar; |
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 | |
function csv2array($content, $delim = ';', $encl = '"', $optional = 1) { | |
if ($content[strlen($content)-1]!="\r" && $content[strlen($content)-1]!="\n") | |
$content .= "\r\n"; | |
$reg = '/(('.$encl.')'.($optional?'?(?(2)':'(').'[^'.$encl.']*'.$encl.'|[^'.$delim.'\r\n]*))('.$delim.'|\r\n)/smi'; | |
preg_match_all($reg, $content, $treffer); | |
$linecount = 0; |
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 | |
function wpt_remove_gallery_css( $css ) { | |
return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); | |
} | |
add_filter( 'gallery_style', 'wpt_remove_gallery_css' ); | |
?> |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* New Contacts Fiels | |
/*-----------------------------------------------------------------------------------*/ | |
function new_contactmethods( $contactmethods ) { | |
$contactmethods['photo'] = 'Photo Link'; | |
$contactmethods['position'] = 'Position'; | |
$contactmethods['twitter'] = 'Twitter'; // Add Twitter |
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 | |
function theme_slug_filter_the_content( $content ) { | |
$custom_content = 'YOUR CONTENT GOES HERE'; | |
$custom_content .= $content; | |
return $custom_content; | |
} | |
add_filter( 'the_content', 'theme_slug_filter_the_content' ); | |
?> |
OlderNewer