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 sort_archive_by_name( $query ) { | |
/* | |
* Change the 'if' condition to the taxonomy/category you want to apply the new sorting | |
*/ | |
if ( is_tax('product-category') ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'sort_archive_by_name' ); |
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
// usage on page: | |
// echo wp_oembed_get('https://www.youtube.com/watch?v=123qweasd', array('width'=>458, 'autoplay'=>0, 'rel'=>0, 'showinfo'=>0 )); | |
// add parameters to oembed | |
add_filter('oembed_result','lc_oembed_result', 10, 3); | |
function lc_oembed_result($html, $url, $args) { | |
// $args includes custom argument | |
$newargs = $args; |
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
// Display 24 products per page | |
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 ); |
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
// will not work in functions.php, use in plugins only | |
function woo_changes(){ | |
//remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 ); | |
//add_action( 'woocommerce_checkout_after_customer_details', 'woocommerce_order_review', 10 ); | |
} | |
add_action('plugins_loaded','woo_changes'); |
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
// Removes the 'Project Category:' or 'Category:' part in archive's h1 | |
add_filter( 'get_the_archive_title', function ($title) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} elseif ( is_author() ) { | |
$title = '<span class="vcard">' . get_the_author() . '</span>' ; | |
} elseif ( is_tax() ) { | |
$title = single_term_title( '', false ); |
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 | |
/* | |
* Use the Toolset Layouts loop if it's active. | |
* Usage: Replace the standard loop in the template file | |
*/ | |
if ( function_exists('the_ddlayout') ) { | |
// Toolset Layouts | |
the_ddlayout(); | |
} else { | |
// Standard WP loop |
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
// WP-Types: disable content template | |
function types_remove_template_selector() { | |
remove_meta_box( 'views_template', 'post', 'side' ); | |
remove_meta_box( 'views_template', 'page', 'side' ); | |
} | |
add_action( 'admin_head', 'types_remove_template_selector', 20); |
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
/* | |
* Replace all SVG images with inline SVG | |
*/ | |
jQuery('img.svg').each(function(){ | |
var $img = jQuery(this); | |
var imgID = $img.attr('id'); | |
var imgClass = $img.attr('class'); | |
var imgURL = $img.attr('src'); | |
jQuery.get(imgURL, function(data) { |
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
.blockquote { | |
p { | |
&:before { | |
content: '\201C'; // “ | |
} | |
&:after { | |
content: '\201D'; // ” | |
} | |
} |
OlderNewer