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 | |
$cat = get_categories( array( | |
'taxonomy' => 'product_cat' | |
) ); | |
foreach( $cat as $key => $value ){ | |
echo $value->name; | |
echo wp_get_attachment_url( get_term_meta( $value->term_id, 'thumbnail_id', true ) ); | |
echo get_term_link( $value->term_id, 'product_cat' ); | |
var_dump( $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
<?php | |
if( is_user_logged_in() ) { | |
$user = wp_get_current_user(); | |
echo $user->display_name; | |
} |
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 | |
$product = wc_get_product( get_the_ID() ); | |
$gallery = $product->get_gallery_attachment_ids(); | |
foreach ( $gallery as $key => $value ) { | |
$img = wp_get_attachment_image_src( $value, 'full' ); | |
echo $img[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 | |
var_dump('is_shop '.is_shop()); | |
var_dump('is_product '.is_product()); | |
var_dump('is_single '.is_single()); | |
var_dump('is_archive '.is_archive()); | |
var_dump('is_page '.is_page()); | |
var_dump('is_product_category '.is_product_category()); | |
var_dump('is_woocommerce '.is_woocommerce()); |
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 | |
add_filter('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Woocommerce']['woocommerce_attribute'] = 'Atributo'; | |
return $choices; | |
} | |
add_filter('acf/location/rule_values/woocommerce_attribute', 'acf_location_rules_values_woocommerce_attribute'); | |
function acf_location_rules_values_woocommerce_attribute( $choices ) { | |
$atributes = wc_get_attribute_taxonomies(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style> | |
img {max-width:100%; } | |
</style> | |
</head> | |
<body> |
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
#/etc/apache2/sites-available/000-default.conf | |
DocumentRoot /home/user/Projects | |
<Directory /home/user/Projects/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
Require all granted | |
</Directory> |
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 | |
$aFotos = get_post_gallery(get_the_ID(), false); | |
$aFotosId = explode(',',$aFotos['ids']); | |
$aFotos = $aFotos['src']; | |
foreach ($aFotosId as $key => $value) { | |
echo $aFotos[$key]; | |
} |
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 | |
if(strtotime(date('d-m-Y')) > strtotime('27-11-2016')) { | |
echo 'OK'; | |
} |
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
$.fancybox.open({ | |
href:'image.jpg' | |
}); |