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 | |
$async = ( $atts['async'] == "true" ) ? $atts['async'] : ""; | |
$custom_terms = get_terms('product_category'); | |
$posts = get_posts( | |
array( | |
'posts_per_page' => $atts['items'], | |
'post_type' => 'projects', | |
'order' => 'ASC', | |
'odrerby' => 'date', |
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_footer', 'my_ajax' ); | |
function my_ajax(){ | |
$site_url = get_site_url(); | |
$ajax_nonce = wp_create_nonce( "my-nonce" ); | |
?> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('.item').on('click', function(e){ |
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
/* | |
*CURL less method to get the content from the url whether it is a HTTP or HTTPS | |
*Not safe for HTTPS, for testing purpose only. | |
*Used for simple comunication with REST API. | |
*/ | |
$data = array('key' => 'value'); | |
$url = 'https://example.com/'; |
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
#Wordpress, wp-content/themes/theme-name/function.php | |
#Add custom css class to body classes. | |
add_filter( 'body_class', 'your_function'); | |
function your_function($classes){ | |
if(true){ | |
return array_merge( $classes, array( 'class_name' ) ); | |
} else{ | |
return array_merge( $classes, array( 'other_class_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
#Allow to enable redirect from http://www.example.com/ and http://example.com/ TO=====> https://www.example.com/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_SCHEME} ^http$ | |
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)$ [NC] | |
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R] | |
</IfModule> |
NewerOlder