Skip to main content

Posts

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: Get store information

Get store data     Mage::app()->getStore();     Store Id     Mage::app()->getStore()->getStoreId();     Store code     Mage::app()->getStore()->getCode();     Website Id     Mage::app()->getStore()->getWebsiteId();     Store Name     Mage::app()->getStore()->getName();     Is Active     Mage::app()->getStore()->getIsActive();     Store Home Url     Mage::app()->getStore()->getHomeUrl();

Text Slider with animation in jquery

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script><br /> <script src="http://artifexonline.dyndns.biz:8081/projects/wp_yourrighthand/code/wp-content/themes/yourrighthand/js/jquery.bxslider.min.js" type="text/javascript"></script> <script> jQuery(document).ready(function() {      $('.testimonials-slider').bxSlider({        mode: 'fade', slideWidth: 400, minSlides: 1, maxSlides: 1, slideMargin: 100, pause: 9000, auto: false, stopAuto: false,  }); }); </script> <script src="jquery.easing.1.3.min.js"></script> <script> $(document).ready(function() {   $("#text-slidein")                     .animate({                         width:500,         ...

Magento get review view.phtml

<?php /**  * Magento  *  * NOTICE OF LICENSE  *  * This source file is subject to the Academic Free License (AFL 3.0)  * that is bundled with this package in the file LICENSE_AFL.txt.  * It is also available through the world-wide-web at this URL:  * http://opensource.org/licenses/afl-3.0.php  * If you did not receive a copy of the license and are unable to  * obtain it through the world-wide-web, please send an email  * to license@magentocommerce.com so we can send you a copy immediately.  *  * DISCLAIMER  *  * Do not edit or add to this file if you wish to upgrade Magento to newer  * versions in the future. If you wish to customize Magento for your  * needs please refer to http://www.magentocommerce.com for more information.  *  * @category    design  * @package     base_default  * @copyright   Copyright (c) 2013 Magento Inc. (http...

Smarty Pagination with php mysql

Smarty Pagination with php mysql ------------------------------------------------------------- --------------------------------------------------------------  <?php  Pagination using PHP,Smarty And MySql $sql="SELECT * FROM `fieldname1` WHERE is_active='Y' ORDER BY fieldmame2"; $rs=mysql_query($sql); $num=mysql_num_rows($rs); $i=0; /*while ($row = mysql_fetch_array($rs)) { $arr1[$j] = $row; $j++; }*/ //////////////////////////////////////////// if (!(isset($pagenum))) { $pagenum = 1; } //Here we count the number of results //Edit $data to be your query $rows = $num; //This is the number of results displayed per page $page_rows = 2; //This tells us the page number of our last page $last = ceil($rows/$page_rows); //this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //This sets the range to display in our query $max = 'LIMIT ' .($pagen...

choosen jquery select box

choosen jquery: http://harvesthq.github.io/chosen/ ------------------------------------------------------------------------------------------------------------------- <?php // Connect to the DB $link = mysqli_connect("localhost","root","","products") or die("Error " . mysqli_error($link)); // store in the DB if(!empty($_POST['ok'])) {        // first delete the records marked for deletion. Why? Because we don't want to process them in the code below     if( !empty($_POST['delete_ids']) and is_array($_POST['delete_ids'])) {         // you can optimize below into a single query, but let's keep it simple and clear for now:         foreach($_POST['delete_ids'] as $id) {             $sql = "DELETE FROM products WHERE id=$id";             $link->query($sql);     ...

JQuery show 5 item

  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <div class="demo"> <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> <li>11</li> <li>12</li> <li>13</li> <li>14</li> <li>15</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> <li>11</li> <li>12</li> <li>13</li> <li>14</li> <li>15</li> </ul> </div> <a class="prev">prev</a> | <a class="next">next</a> ...

Magneto Get all product image

<?php $_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages(); ?> <?php if($_images){?>               <?php $i=0; foreach($_images as $_image){ $i++; ?>         <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(108,90); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel());?>" title="<?php $this->htmlEscape($_image->getLabel());?>" /><?php } ?>     <?php } ?>