Skip to main content

Get Google Calendar Event List in WordPress

<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function  get_calender_events() { $params = array(); /*Get current date*/ $current_date  = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key =  "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...

Magento mobile menu

Magento mobile menu

<script>
var jq=jQuery.noConflict();
jq(document).ready(function(){
  jq(".menu-nav-button").click(function(){
        if ( jq( this ).hasClass( "close-menu" ) ) {
  jq(this).removeClass('close-menu');
 }else{
  jq(this).addClass('close-menu');
}
    jq("#mobile-memu").slideToggle();
  });
  jq(".parent > ul").hide();
   jq("#mobile-memu").find("li").has("ul").addClass("closed").prepend("<img class='icon' src='<?php echo $this->getSkinUrl('images/icon_arrow_right.png'); ?>'/>");
jq("#mobile-memu").on("click", ".icon", function(e) {
jq(this).parent().find("ul").first().slideToggle();
if( jq(this).parent().hasClass("closed") ) {
jq(this).attr("src", "<?php echo $this->getSkinUrl('images/icon_arrow_down.png'); ?>");
                   jq(this).parent().removeClass("closed").addClass("open");
}
else {
                                        jq(this).attr("src", "<?php echo $this->getSkinUrl('images/icon_arrow_right.png'); ?>");
                                  jq(this).parent().removeClass("open").addClass("closed");
}

e.stopPropagation();
});
});
</script>
<style>
.main-menu .mobile-memu{ display:none; position:absolute; top:-2px; right:0; width:100%; z-index:999;}
.main-menu .mobile-memu .nav-container{ display:block;}

.main-menu .mobile-memu li{ display:block; text-align:left; background-color:#C6C7C8; padding:0; position:relative;}
.main-menu .mobile-memu ul li a span{ border:none;}
.main-menu .mobile-memu ul li a{ color:#fff; border-bottom:1px solid #fff; padding:15px 10px;}
.main-menu .mobile-memu ul li a:hover,
.main-menu .mobile-memu #nav ul li a:hover{ background-color:#FBDECC; color:#959595 !important; transition:all .3s; -moz-transition:all .3s; -o-transition:all .3s; -webkit-transition:all .3s;}


.main-menu .mobile-memu ul li:hover a span{ border-bottom:none;}

.main-menu .mobile-memu #nav ul li a{ padding:10px 25px; color:#fff !important;}

.main-menu .mobile-memu #nav ul,
.main-menu .mobile-memu #nav div{ left:0; position:static; width:100%;}

.main-menu .mobile-memu #nav ul li{ padding:0;}
.main-menu .mobile-memu #nav ul li + li{ background:#C6C7C8;}

.main-menu .mobile-memu .icon{ background:#fbdecc; color:#959595; text-align:center; font-size:18px; font-weight:normal; position:absolute; top:0; right:0; cursor:pointer; max-width:15px; padding:16px;}
.menu-nav{ width:42px; height:42px; display:none; position:absolute; top:18px; right:15px; z-index:9999;}
.menu-nav .menu-nav-button{ background-color:#c6c7c8; border:1px solid #fff; display:block; background-image:url(../images/mobile-menu.png); background-position:center center; background-repeat:no-repeat; text-indent:-99999px; width:40px; height:40px;}
.menu-nav .menu-nav-button.close-menu{background-image:url(../images/mobile-close.png);}




</style>

 <div class="main-menu">
            <span class="menu-nav">
            <a href="javascript:void(0);" class="menu-nav-button">Menu</a>
            </span>
             
                    <?php echo $this->getChildHtml('topMenu') ?>
                   
                   <div id="mobile-memu" class="mobile-memu"> <?php echo $this->getChildHtml('topMenu') ?></div>
  </div>
 
 

Comments

Popular posts from this blog

Create Signature pad with save on database in php

Create Signature pad with save on database in php 1.create a folder images index.php ============   <!DOCTYPE >     <head>     <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />     <title>Signature Pad</title>     <script type="text/javascript" src="jquery-1.8.0.min.js"></script>     <script type="text/javascript"> $(document).ready(function () {     /** Set Canvas Size **/     var canvasWidth = 400;     var canvasHeight = 100;     /** IE SUPPORT **/     var canvasDiv = document.getElementById('signaturePad');     canvas = document.createElement('canvas');     canvas.setAttribute('width', canvasWidth);     canvas.setAttribute('height', canvasHeight);     canvas.setAttribute('id', 'canvas');     canvasDiv.appendChild(canvas);    ...

Get Google Calendar Event List in WordPress

<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function  get_calender_events() { $params = array(); /*Get current date*/ $current_date  = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key =  "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...

WooCommerce Mini cart With Ajax

WooCommerce Mini cart //MINI CART SECTION   <div class="productdiv rightcart">                                                         <?php if ( ! WC()->cart->is_empty() ) : ?>     <ul class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr( $args['list_class'] ); ?>">         <?php             do_action( 'woocommerce_before_mini_cart_contents' );             foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {                 $_product     = apply_filters( 'woocommerce_cart_item_pro...