Element -- selects all h2
elements on the page
h2 {
foo: bar;
<?php if (qtrans_getLanguage() == 'en') { ?> | |
<!-- stuff for English --> | |
<?php } elseif (qtrans_getLanguage() == 'es') { ?> | |
<!-- other stuff Spanish --> | |
<?php } ?> |
<?php | |
/** | |
* For developers: WordPress debugging mode. | |
* | |
* If the default WP_DEBUG function is set to false and | |
* there are still warnings or errors showing up, try | |
* using the following instead | |
*/ | |
ini_set('log_errors','On'); | |
ini_set('display_errors','Off'); |
add_action( 'template_redirect', 'wpsites_attachment_redirect' ); | |
function wpsites_attachment_redirect(){ | |
global $post; | |
if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ) : | |
wp_redirect( get_permalink( $post->post_parent ), 301 ); | |
exit(); | |
wp_reset_postdata(); | |
endif; | |
} |
Movable Type has never been Free Software, as defined by the Free Software | |
Foundation. It has never been open source software, as defined by the Open | |
Source Initiative. Six Apart survived and thrived in the blogging community | |
because Movable Type was “free enough.” | |
… | |
Many people misunderstand | |
Free Software and the GNU General Public License. Many people equate the GPL to | |
the boogeyman, because it’s “viral”, and that sounds like a bad thing. |
<?php | |
add_shortcode( 'areas', 'custom_query_shortcode' ); | |
function custom_query_shortcode( $atts ) { | |
// EXAMPLE USAGE: | |
// [areas show_posts="100" post_type="page" post_parent="246"] | |
// Defaults | |
$defaults = array( | |
"show_posts" => 100, | |
"post_type" => 'page', |
<?php | |
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
//JS to add fields for new variations | |
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
//Save variation fields | |
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 ); | |
/** |
/** | |
* woocommerce_package_rates is a 2.1+ hook | |
*/ | |
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 ); | |
/** | |
* Hide shipping rates when free shipping is available | |
* | |
* @param array $rates Array of rates found for the package | |
* @param array $package The package array/object being shipped |