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 | |
$number_of_posts_per_page = 9; | |
$initial_offset = 1; | |
$paged = ( get_query_var('page') ) ? get_query_var('page') : 1; | |
// Use paged if this is not on the front page | |
$number_of_posts_past = $number_of_posts_per_page * ($paged - 1); | |
$off = $initial_offset + (($paged > 1) ? $number_of_posts_past : 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
<!doctype html> | |
<html amp lang="pt-BR"> | |
<head> | |
<meta charset="utf-8"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<link rel="canonical" href="http://caminho_do_arquivo_original/arquivo.html"> | |
<title>Página compatvel com AMP</title> | |
<link rel="canonical" href="http://example.ampproject.org/article-metadata.html" /> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{ |
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 | |
//Replaces product price by out of stock message in case a variable product is out of stock (optional) | |
add_action('woocommerce_before_single_product_summary',function(){ | |
if(is_product()){ | |
global $product; | |
if(!$product->is_in_stock()){ | |
remove_action('woocommerce_single_variation','woocommerce_single_variation'); | |
remove_action('woocommerce_single_product_summary','woocommerce_template_single_price'); | |
add_action('woocommerce_single_product_summary',function(){ | |
?> |
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 | |
//Shows out of stock message when a variable product has all variations out of stock | |
add_filter('wp_footer', function(){ | |
if(is_product()){ | |
global $product; | |
if($product->is_type('variable')){ | |
if(!$product->is_in_stock()){ | |
?> | |
<script> | |
jQuery(window).load(function(){ |
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_shop() || is_product_category() || is_product_tag() ) { // Only run on shop archive pages, not single products or other pages | |
// Products per page | |
$per_page = 24; | |
if ( get_query_var( 'taxonomy' ) ) { // If on a product taxonomy archive (category or tag) | |
$args = array( |
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 | |
$args = array( | |
'posts_per_page' => 7, | |
'post_type' => 'product', | |
'product_cat' => 'home-featured', | |
'meta_key' => 'home_featured_order', | |
'orderby' => 'meta_value_num', | |
'order' => 'DESC' | |
); |
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
/* | |
Created by: Mauricio Rocha | |
www.sampapix.com.br | |
Install the plugins below, use -global or --save-dev either way will work. | |
gulp, gulp-jade, gulp-concat, gulp-uglify, gulp-minify-css, gulp-stylus, gulp-obfuscate, gulp-connect | |
Create the folders below inside your project folder: | |
src, src/js, src/styl | |
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
add_filter( 'the_content', 'post_love_display', 99 ); | |
function post_love_display( $content ) { | |
$love_text = ''; | |
if ( is_single() ) { | |
$love = get_post_meta( get_the_ID(), 'post_love', true ); | |
$love = ( empty( $love ) ) ? 0 : $love; | |
$love_text = '<p class="love-received"><a class="love-button" href="#" data-id="' . get_the_ID() . '">give love</a><span id="love-count">' . $love . '</span></p>'; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<defaultDocument> | |
<files> | |
<clear /> | |
<add value="index.php" /> | |
</files> | |
</defaultDocument> | |
<rewrite> |
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
/* (320x480) iPhone (Original, 3G, 3GS) */ | |
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) { | |
/* insert styles here */ | |
} | |
/* (320x480) Smartphone, Portrait */ | |
@media only screen and (device-width: 320px) and (orientation: portrait) { | |
/* insert styles here */ | |
} | |