Skip to content

Instantly share code, notes, and snippets.

@agusmu
agusmu / flying-press.conf
Created Oct 4, 2020 — forked from gijo-varghese/flying-press.conf
Nginx Config for FlyingPress
View flying-press.conf
location ~* \.html$ {
add_header x-flying-press-cache HIT;
add_header x-flying-press-source Nginx;
}
set $flying_press_cache 1;
set $flying_press_url "/wp-content/cache/flying-press/$request_uri/index.html";
set $flying_press_file "$document_root/wp-content/cache/flying-press/$request_uri/index.html";
if ($request_method = POST) {
@agusmu
agusmu / Customizerref.php
Created Mar 29, 2020 — forked from cryptexvinci/Customizerref.php
WordPress Customizer Sample Reference
View Customizerref.php
<?php
/**
* WordPress Customizer Comprehensive Reference
* Compiled by @ti_asif
*/
Panel
Section
@agusmu
agusmu / style.css
Created Oct 6, 2018
Custom CSS - Theme Puca - WPBisnis WhatsApp Rotator
View style.css
/* ganti warna whatsapp button jadi hijau */
.singular-shop div.product .information .single_add_to_cart_button.single_whatsapp_button {
background: #25d366 !important;
}
/* atur posisi mobile sticky button */
@media (max-width: 767px) {
/* addtocart button di atas */
.singular-shop div.product .information .cart .button.single_add_to_cart_button {
bottom: 50px !important;
}
View github-to-bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@agusmu
agusmu / functions.php
Created Oct 10, 2016 — forked from fervous/functions.php
Show shipping by vendor next to item in cart
View functions.php
// SHIPPING IN CART
add_filter( 'woocommerce_cart_item_name', 'wcv_shipping_cart_item', 1, 3 );
function wcv_shipping_cart_item( $title = null, $cart_item = null, $cart_item_key = null ) {
$settings = get_option( 'woocommerce_wcv_pro_vendor_shipping_settings' );
$customer_address = array( 'country' => WC()->customer->get_shipping_country(), 'state' => WC()->customer->get_shipping_state() );
$package = array( 'destination' => $customer_address );
$shipping_rate = WCVendors_Pro_Shipping_Method::get_shipping_rate( $cart_item[ 'product_id' ], $cart_item['data']->post->post_author, $package, $settings );
if( $cart_item_key && is_cart() ) {
echo $title. '<br /><span class=""><br>Shipping : ' . get_woocommerce_currency_symbol(). $shipping_rate->fee . '</span>';
View dynamic_image_downsize.php
<?php
/**
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes.
*
* <p>Because Wordpress generates all image sizes on first upload, if you change
* theme or size settings after the upload, there won't be a matching file for
* the requested size.<br/>
* This filter addresses the problem of the default downsize process laoding
* a large file and scaling it down in the browser if it doesn't find the right
* size image. This can cause large files to be loaded unnecessarily and will
@agusmu
agusmu / customtemplate.php
Last active Jan 18, 2019
OnePageCheckout - Automatically Add To Cart Item
View customtemplate.php
<?php
/**
* Template to display product selection fields in a table (with thumbnail etc.)
*
* @package WooCommerce-One-Page-Checkout/Templates
* @version 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
View WordPress disable the attachment page by redirecting
if ( $post->post_parent )
{
wp_redirect( get_permalink( $post->post_parent ), 301 );
}
else
{
wp_redirect( site_url(), 301 ) );
}
die();
@agusmu
agusmu / category.php
Created Mar 22, 2015
Genesis Framework
View category.php
<?php
/* Remove Default Genesis Loop Output */
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
@agusmu
agusmu / style.css
Created Mar 4, 2015
Eventica WordPress Theme - Colors
View style.css
// events slider - detail background
.home-slider-events .slide-event-detail {
background: rgba(28, 171, 197, 0.85);
}
// event list - date box (top left)
.tribe-events-list .tribe-events-event-date {
background: rgba(62, 201, 206, 0.64);
}
You can’t perform that action at this time.