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_action('wp_enqueue_scripts', 'enqueue_scripts'); | |
function enqueue_scripts() { | |
wp_enqueue_style( 'main', get_template_directory_uri().'/style.css' ); | |
} |
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 | |
$post_id = wp_insert_post( array( | |
'post_content' => 'Content', | |
'post_title' => 'Title', | |
'post_type' => 'custom_post_type', | |
'tax_input' => array( 'taxonomy_post_type' ) | |
) ); | |
wp_set_object_terms( $post_id, 'custom_taxonomy', 'taxonomy_post_type', true ); |
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_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
if( !isset( $post_id ) ) return; | |
if( get_the_title( $post_id ) == 'Home' ){ | |
remove_post_type_support( 'page', 'editor' ); | |
} | |
} |
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' | |
}); |
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
<?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
#/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
<!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
<?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
<?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()); |