Skip to content

Instantly share code, notes, and snippets.

@agusmu
agusmu / Customizerref.php
Created March 29, 2020 05:29 — forked from cryptexvinci/Customizerref.php
WordPress Customizer Sample Reference
<?php
/**
* WordPress Customizer Comprehensive Reference
* Compiled by @ti_asif
*/
Panel
Section
@agusmu
agusmu / style.css
Created October 6, 2018 01:05
Custom CSS - Theme Puca - WPBisnis WhatsApp Rotator
/* 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;
}
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 October 10, 2016 02:55 — forked from fervous/functions.php
Show shipping by vendor next to item in cart
// 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>';
<?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 January 18, 2019 21:33
OnePageCheckout - Automatically Add To Cart Item
<?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
if ( $post->post_parent )
{
wp_redirect( get_permalink( $post->post_parent ), 301 );
}
else
{
wp_redirect( site_url(), 301 ) );
}
die();
@agusmu
agusmu / category.php
Created March 22, 2015 18:28
Genesis Framework
<?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 March 4, 2015 00:54
Eventica WordPress Theme - Colors
// 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);
}
@agusmu
agusmu / spp.php
Last active August 18, 2019 16:25 — forked from khromov/spp.php
<?php
/*
Plugin Name: Simple Popular Posts Lite
Plugin URI: -
Description: -
Version: 2014.10.16
Author: khromov
Author URI: http://snippets.khromov.se
License: GPL2
*/