Skip to content

Instantly share code, notes, and snippets.

Avatar

Spyros Vlachopoulos spyrosvl

View GitHub Profile
@tripflex
tripflex / functions.php
Last active Nov 16, 2020
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
View functions.php
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@mgibbs189
mgibbs189 / test.php
Created Oct 14, 2015
FacetWP - index parent terms and child terms in separate facets
View test.php
<?php
function fwp_index_categories( $params, $class ) {
if ( 'product_cat' == $params['facet_name'] && 0 < (int) $params['depth'] ) {
return false; // skip this term
}
elseif ( 'product_sub_cat' == $params['facet_name'] && 0 == (int) $params['depth'] ) {
return false; // skip this term
}
return $params;
@melissacabral
melissacabral / wp-dimox-breadcrumbs.php
Last active Nov 9, 2020
breadcrumbs - place in functions.php and call in your theme with dimox_breadcrumbs() [Source](http://dimox.net/wordpress-breadcrumbs-without-a-plugin/)
View wp-dimox-breadcrumbs.php
<?php
/**
* Dimox Breadcrumbs
* http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
* Since ver 1.0
* Add this to any template file by calling dimox_breadcrumbs()
* Changes: MC added taxonomy support
*/
function dimox_breadcrumbs(){
/* === OPTIONS === */
You can’t perform that action at this time.