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 | |
// This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
// ... | |
// register and enqueue loadCSS | |
function load_scripts_and_styles() { | |
// register loadCSS | |
wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', 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 | |
// remove product description from single product pages | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 ); | |
add_filter( 'woocommerce_product_tabs', 'wc_remove_description_tab', 11, 1 ); | |
function wc_remove_description_tab( $tabs ) { | |
if ( isset( $tabs['description'] ) ) { | |
unset( $tabs['description'] ); | |
} | |
} | |
?> |
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
IE6 Only | |
================== | |
_selector {...} | |
IE6 & IE7 | |
================== | |
*html or { _property: } | |
IE7 Only | |
================== |
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 | |
/** | |
* Функция склонения числительных в русском языке | |
* | |
* @param int $number Число которое нужно просклонять | |
* @param array $titles Массив слов для склонения | |
* @return string | |
**/ | |
$titles = array('котик', 'котика', 'котиков'); | |
function declOfNum($number, $titles) |
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
$(window).on("scroll", function() { | |
var scrollHeight = $(document).height(); | |
var scrollPosition = $(window).height() + $(window).scrollTop(); | |
if ((scrollHeight - scrollPosition) / scrollHeight === 0) { | |
// when scroll to bottom of the page | |
} | |
}); |
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_customize->add_setting( 'themeslug_dropdownpages_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_dropdown_pages', | |
) ); | |
$wp_customize->add_control( 'themeslug_dropdownpages_setting_id', array( | |
'type' => 'dropdown-pages', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Dropdown Pages' ), | |
'description' => __( 'This is a custom dropdown pages option.' ), |
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 | |
$args = array( | |
'post_type' => 'product', | |
'post_status' => 'publish', | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
'relation' => 'AND', | |
array ( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', |
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 | |
/** | |
* Returns all img tags in a HTML string with the option to include img tag attributes | |
* | |
* @author Joshua Baker | |
* | |
* @example $post_images[0]->html = <img src="example.jpg"> | |
* $post_images[0]->attr->width = 500 | |
* |
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
/* Modern Font Stacks */ | |
/* System */ | |
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | |
/* Times New Roman-based serif */ | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
/* A modern Georgia-based serif */ | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |
OlderNewer