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
// Get the attibutes | |
$attributes = $product->get_attributes(); | |
// Loop and display the value | |
// var_dump $attributes to see what you can output | |
foreach ($attributes as $attribute) { | |
echo $attribute['value']; | |
} |
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
$args = apply_filters( 'woocommerce_product_subcategories_args', array( | |
'parent' => $parent_id, | |
'menu_order' => 'ASC', | |
'hide_empty' => 0, | |
'hierarchical' => 1, | |
'taxonomy' => 'product_cat', | |
'pad_counts' => 1 | |
) ); | |
// Update: Use this in your functions.php: |
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
// Paste this in your file, somewhere in the loop, around the h3 | |
<?php echo $product->sku; ?> <?php echo $product->omschrijving; ?> <?php the_title(); ?> | |
<?php | |
// Get the attributes | |
$attributes = $product->get_attributes(); | |
// Start the loop | |
foreach ( $attributes as $attribute ) : ?> | |
<?php |
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 | |
$taxonomy = 'your_taxonomy_name'; | |
$terms = get_terms($taxonomy); // Get all terms of a taxonomy | |
if ( $terms && !is_wp_error( $terms ) ) : ?> | |
<ul> | |
<?php foreach ( $terms as $term ) { ?> | |
<li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>"><?php echo $term->name; ?></a></li> | |
<?php } ?> | |
</ul> |
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 | |
$customPostTaxonomies = get_object_taxonomies('foo'); | |
if(count($customPostTaxonomies) > 0) | |
{ | |
foreach($customPostTaxonomies as $tax) | |
{ | |
$args = array( | |
'orderby' => 'name', | |
'show_count' => 0, |
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 | |
$taxonomy = 'foo_cat'; // Your category | |
$terms = get_the_terms($post->ID, $taxonomy ); // Get data for post ID | |
if ( $terms && !is_wp_error( $terms ) ) : | |
?> | |
<?php foreach ( $terms as $term ) { ?> | |
<li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>"><?php echo $term->name; ?></a></li> | |
<?php } ?> |
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
/* Vertical align | |
* Use this mixin or placeholder to vertical align elements | |
* @corinneroosen | |
*/ | |
// Mixin | |
@mixin vertical-align { | |
position: relative; // Sometimes you need to try "absolute" here | |
top: 50%; | |
-webkit-transform: translateY(-50%); |
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
// Fancy "I Miss You" page title | |
var missingYou = function() { | |
// Set blur/focus to check if browsertab is active | |
$(window).on('blur', function() { | |
document.title = "I miss you ♥"; | |
}).on('focus', function() { | |
document.title = "Welcome back!"; | |
}); | |
}; |
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
.parent-element { | |
-webkit-transform-style: preserve-3d; | |
-moz-transform-style: preserve-3d; | |
transform-style: preserve-3d; | |
} | |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); |
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
foreach( get_terms( 'product-categories', array( 'hide_empty' => false, 'parent' => 0 ) ) as $parent_term ) { | |
// display top level term name | |
echo $parent_term->name; | |
foreach( get_terms( 'product-categories', array( 'hide_empty' => false, 'parent' => $parent_term->term_id ) ) as $child_term ) { | |
// display name of all childs of the parent term | |
echo $child_term->name; | |
} | |
} |
OlderNewer