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, ...

PHP interview questions and answers for freshers

PHP interview questions and answers for freshers 1.What is the difference between a static and Dynamic Web site? 2.What is the meaning of Open Source Software? 3.Why was PHP developed, what it is used for, and where can you get it? 4.What are the benefits of using PHP and MySQL? The above FOUR questions you should know before go to this topic. Ans: 1 A static website is one that is written in HTML only. Each page is a separate document and there is no database that it draws on. What this means functionally is that the only way to edit the site is to go into each page and edit the HTML - So you would have to do it yourself using a web page editor such as FrontPage or Dreamweaver, or pay your web developer to make updates for you. A dynamic website is created by webdevelopers who are strong in ASP.Net, PHP, JAVA and more... This website pages contains data is retrieved from certain database. Each time the vie...

Wordpress Add Custom Menu

Plugin: http://wordpress.org/plugins/custom-post-type-cpt-cusom-taxonomy-ct-manager/ Wordpress Add Recipe Custom Menu Ad following code Function.php file register_post_type( 'recipes', array( 'labels' => array( 'name' => 'Recipe', 'singular_name' => 'Recipe', 'add_new' => 'Add New', 'add_new_item' => 'Add New Recipe', 'edit_item' => 'Edit Recipe', 'edit' => 'Edit', 'new_item' => 'New Recipe', 'view_item' => 'View Recipe', 'search_items' => 'Search Recipes', 'not_found' => 'No recipes found', 'not_found_in_trash' => 'No recipes found in Trash', 'view' => 'View Recipe' ), 'public' => true, 'capability_type' => 'post', 'hierarchical' => false, 're...

Fix Category Url Filter in Magento Layered Navigation

Fix Category Url Filter in Magento Layered Navigation www.yoursite.com/electronics.html?cat=12-> www.yoursite.com/electronics/cameras.html This can be fixed quite easily by overriding the getUrl()  method in the  Mage_Catalog_Model_Layer_Filter_Item class (Accessible at: /app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php ) The code Right, down to the fun part! Locate the function at line 57, it should look like this: public function getUrl() {      $query = array(          $this->getFilter()->getRequestVar()=>$this->getValue(),          Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls      );      return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query)); } Now you need to edit this co...

Magento. How to edit Contact us page

Magento. How to edit Contact us page How to change the title of the browser tab on the “Contacts” page? On your  FTP server in the folder where the Magento files are stored, go to \app\design\frontend\default\theme _number \layout and open  a  file called contacts.xml to edit. Change the name of the page  where it says   < reference name = "head" >< br >    < action   method = "setTitle" translate = "title"   module = "contacts" >< title >< strong >Contact Us</ strong ></ title ></ action >< br > </ reference >   How to change the form field text on the “Contacts” page? On your FTP server go to \magento\app\design\frontend\base\default\template\contacts and open a file called form.phtml to edit. Hit Ctrl  (MAC: Command) + F to look for the text to change it. Save your changes once you are done. How to define your  Magento store contac...

Mouseenter And Mouseleave Jquery Example

Mouseenter And Mouseleave Jquery Example <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> $(document).ready(function() { $('.menu-link').mouseenter(function(){ var callss=this.id; $('.menuDescription').css('display','none'); $('.'+callss).show(); }).mouseleave(function() { $('.menuDescription').css('display','none'); }); }); </script> <style> .menuDescription {    position: absolute;    background:#EB088D;    color:#fff;    font-weight:bold;    padding:2px 3px;    z-index:99999; } </style> <ul id="menu" class="menu"> <br> <li id="menu1" class="menu-link"><a href="/">LINK1</a></li> <li id="menu2" class="menu-link">...

Add jQuery.noConflict() In Magento

Add  jQuery.noConflict() In Magento In app\design\frontend\base\default\layout\page. xml add following code. < reference name = "head" >     < block type = "core/text"  name = "google.jquery" >< action method = "setText" >< text ><! [CDATA[ < script type = "text/javascript"  src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" > </script>]] ></ text ></ action ></ block >     < block type = "core/text"  name = "google.jquery.noconflict"  after = "google.jquery" >< action method = "setText" >< text ><! [CDATA[ < script type = "text/javascript" >var  $j  =  jQuery . noConflict ();  </script>]] ></ text ></ action ></ block > </ reference > This will cause no conflicts with prototype, if you define noCon...

Jquery Popup

Example 1 <!DOCTYPE HTML> <html> <head>     <title>Jquery Twitter Style Popup</title> </head> <body> <body> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script></head> <div style="padding-top:100px;text-align: center;"> <a class="popup-link-1"><b>Click me for a popup!</b></a> </div> <div class="popup-box" id="popup-box-1"><div class="close">X</div><div class="top"><h2>Jquery Twitter Style Popup</h2></div><div class="bottom">This is what we will be making (or maybe what we already have) in this tutorial. If you like this, please share. It really helps!</div></div> <div id="blackout"></div> <script> $(document).ready(function() { ...