This file contains hidden or 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
add_filter('woocommerce_subcategory_count_html', 'my_subcategory_filter', 10, 2); | |
function my_subcategory_filter($markup, $category) { | |
return '<div class="my_new_class">' . $category->count . ' subcategories</div>'; | |
} |
This file contains hidden or 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
var myWidgets = myWidgets || {}; | |
// Model for a single testimonial | |
myWidgets.Testimonial = Backbone.Model.extend({ | |
defaults: { 'quote': '', 'author': '' } | |
}); | |
// Single view, responsible for rendering and manipulation of each single testimonial | |
myWidgets.TestimonialView = Backbone.View.extend( { |
This file contains hidden or 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
#Install PHP CodeSniffer | |
brew install homebrew/php/php-code-sniffer #if using Homebrew | |
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs #if you want to do it directly | |
#Install WordPress Coding Standards | |
git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs | |
#Add WordPress standards to PHPCS config | |
phpcs -i #shows the libraries installed | |
phpcs --config-set installed_paths <path to dir that you cloned>/wpcs |
This file contains hidden or 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
https://codepen.io/cvn/pen/WbXEoX/ |
This file contains hidden or 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 filter_ptags_on_images($content) { | |
$content = preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); | |
return preg_replace('/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content); | |
} | |
add_filter('the_content', 'filter_ptags_on_images'); |
This file contains hidden or 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
highlight_string("<?php\n\$data =\n" . var_export($variable, true) . ";\n?>"); |
This file contains hidden or 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 | |
//in theme file | |
echo apply_filters('prefix_advertisement_text', 'advertisement'); | |
//add this in child theme function to change it | |
function prefix_myad_text() { | |
return 'MY CUSTOM TEXT'; | |
} | |
add_filter('prefix_advertisement_text','prefix_myad_text'); |
This file contains hidden or 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
/* MIXINs */ | |
@mixin transition( $val : ease 0.5s ) { | |
-webkit-transition: $val; | |
-moz-transition:$val; | |
-o-transition:$val; | |
-ms-transition:$val; | |
transition:$val; | |
} | |
@mixin text-shadow( $top: 3px, $left: 3px, $blur: 3px , $colour: #333 ) { |
This file contains hidden or 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
<!-- PORTFOLIO SECTION --> | |
<h2> | |
<?php | |
if ( function_exists('pll_register_string') ) { | |
echo pll__(get_theme_mod('icelock_title_portfolio_section')); | |
} else { | |
echo get_theme_mod('icelock_title_portfolio_section'); | |
} | |
?> |