Skip to content

Instantly share code, notes, and snippets.

@agusmu
agusmu / .htaccess
Created February 19, 2015 10:25
PageSpeed Optimization with Htaccess
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
@agusmu
agusmu / style.css
Created February 16, 2015 09:15
PrimaShop (1.6+) - Show Mobile Menu on Desktop Screen
/* show mobile menu button */
.mobile-icon-nav {
display: block !important;
}
/* show mobile cart button */
.mobile-icon-cart {
display: block !important;
}
/* centering header logo / title */
#header-title,
@agusmu
agusmu / functions.php
Created January 30, 2015 08:34
PrimaShop - Customize Call To Action Text on specific page
add_filter( 'prima_get_setting_calltoaction_text', 'prima_custom_calltoaction_text' );
function prima_custom_calltoaction_text( $text ) {
/* call to action text on homepage */
if ( is_home() || is_front_page() )
$text = 'Get free shipping now!';
/* call to action text on shop page */
if ( is_shop() )
$text = 'Get 10% discount when you purchase $100 or more!';
@agusmu
agusmu / functions.php
Created January 26, 2015 23:50
WooCommerce - Add text/code below product summary
add_action( 'woocommerce_single_product_summary', 'prima_custom_below_product_summary', 55);
function prima_custom_below_product_summary() {
echo 'add your text or code here';
}
@agusmu
agusmu / functions.php
Created January 26, 2015 00:11
WordPress - Force Logout and Redirect After Logout
function amu_force_logout() {
$timeout = 300; // 5 minutes
if ( !is_user_logged_in() )
return;
global $user_ID;
$last_login = get_user_meta($user_ID, 'amu_login', true);
if ( time() > ( $last_login + $timeout ) ) {
<?php
/**
* @class Export_Import_Install_Control
*/
final class Export_Import_Install_Control extends WP_Customize_Control {
/**
* @method render_content
* @protected
@agusmu
agusmu / style.css
Created January 3, 2015 11:01
WooCommerce - Full Width Cart Totals
.woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals {
float: none;
width: 100%;
text-align: left;
}
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
<?php
function sb_edd_filter_license_limit( $limit, $download_id, $license_id, $price_id ) {
$payment_id = get_post_meta( $license_id, '_edd_sl_payment_id', true );
$is_bundle = false;
$bundle_items = array();
$downloads = edd_get_payment_meta_downloads( $payment_id );
if( $downloads ) {
foreach( $downloads as $download ) {
<?php
define( 'THEMENAME', 'Kallyas' );
require_once dirname( __FILE__ ) . '/framework/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'kallyas_register_required_plugins' );
function kallyas_register_required_plugins() {
/**