Skip to content

Instantly share code, notes, and snippets.

@mjinayan80
mjinayan80 / cart-functions.php
Created October 25, 2017 09:50
cart-functions.php
function woocommerce_cart_link() {
global $woocommerce;
?>
<a href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>" title="<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> <?php _e('in your shopping cart', 'woothemes'); ?>" class="cart-button ">
<span class="label"><?php esc_html_e('My Basket:', 'woothemes'); ?></span>
<?php echo esc_html($woocommerce->cart->get_cart_total()); ?>
<span class="items"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); ?></span>
</a>
<?php
}
@mjinayan80
mjinayan80 / cart-functions-filter.php
Created October 25, 2017 09:51
cart-functions-filter.php
function header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
woocommerce_cart_link();
$fragments['a.cart-button'] = ob_get_clean();
return $fragments;
@mjinayan80
mjinayan80 / cart-functions.php
Created October 25, 2017 09:52
cart-functions.php
function woocommerce_cart_link() {
global $woocommerce;
?>
<a href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>" title="<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> <?php _e('in your shopping cart', 'woothemes'); ?>" class="cart-button ">
<span class="label"><?php esc_html_e('My Basket:', 'woothemes'); ?></span>
<?php echo esc_html($woocommerce->cart->get_cart_total()); ?>
<span class="items"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); ?></span>
</a>
<?php
}
@mjinayan80
mjinayan80 / stock-googlemap-shortcode.php
Created October 25, 2017 09:53
stock-googlemap-shortcode.php
<?php
function stock_styled_map_shortcode($atts, $content = null) {
extract( shortcode_atts( array(
'lat' => '40.7433379',
'lng' => '-74.0103219',
'title' => 'Head Office',
'desc' => 'House 21, Grand St.<br/> New York, USA',
@mjinayan80
mjinayan80 / style.css
Created October 25, 2017 09:54
style.css
.shopping-icon {
border: 1px solid #ddd;
border-radius: 50%;
color: #1b80bb;
font-size: 18px;
height: 53px;
line-height: 50px;
position: absolute;
right: 0;
text-align: center;
@mjinayan80
mjinayan80 / index.html
Created October 25, 2017 09:55
index.html
<div class="header-area">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="logo">
<h2><a href="index.html">Stock</a></h2>
</div>
</div>
<div class="col-md-9">
@mjinayan80
mjinayan80 / logocarouselshortcode.php
Created October 25, 2017 09:56
logocarouselshortcode.php
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }
function educare_logo_carousel_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'logos' => '',
'count' => '6',
'tablet_count' => '4',
@mjinayan80
mjinayan80 / google-fonts.php
Created October 25, 2017 10:05
google-fonts.php
<?php
$frozen_body_font_get = cs_get_option('frozen_body_font');
$frozen_heading_font_get = cs_get_option('frozen_headding_font');
function frozen_crazycafe_body_gf_url() {
$font_url = '';
$frozen_body_font_get = cs_get_option('frozen_body_font');
if(array_key_exists('family', $frozen_body_font_get)) {
$frozen_body_font_get_family = $frozen_body_font_get['family'];
@mjinayan80
mjinayan80 / custom-post-loop-with-pagination-shortcode.php
Created October 25, 2017 10:06
custom-post-loop-with-pagination-shortcode.php
<?php
function portfolios_shortcode($atts){
extract( shortcode_atts( array(
'expand' => '',
), $atts) );
global $paged;
$posts_per_page = 6;
$settings = array(
@mjinayan80
mjinayan80 / Custom post loop with pagination
Created October 25, 2017 10:10
Custom post loop with pagination
<?php
global $paged;
$posts_per_page = 9;
$settings = array(
'showposts' => $posts_per_page,
'post_type' => 'portfolio',
'orderby' => 'menu_order',
'order' => 'ASC',
'paged' => $paged)
);