The Difference between do_action, add_action and add_filter

The Foundation: do_action do_action creates the hook for things to hang. This is at the core of WordPress and even frameworks like Genesis and many other themes and plugins. do_action is the first domino in the chain of events with hooks. However, alone, it means nothing and does nothing. Simply, it tells WordPress to search … More The Difference between do_action, add_action and add_filter

AJAX核心对象– XMLHttpRequest 对象使用详解 (一)

多数 Web 应用程序都使用请求/响应模型从服务器上获得完整的HTML 页面。常常是点击一个按钮,等待服务器响应,再点击另一个按钮,然后再等待,这样一个反复的过程。有了 Ajax 和 XMLHttpRequest 对象,就可以使用不必让用户等待服务器响应的请求/响应模型了。 本文中,Brett McLaughlin 介绍了如何创建能够适应不同浏览器的 XMLHttpRequest 实例,建立和发送请求,并响应服务器。 本文中,您将开始接触最基本和基础性的有关 Ajax 的全部对象和编程方法:XMLHttpRequest 对象。该对象实际上仅仅是一个跨越所有 Ajax 应用程序的公共线程,您可能已经预料到,只有彻底理解该对象才能充分发挥编程的潜力。事实上,有时您会发现,要正确地使用 XMLHttpRequest,显然不能 使用 XMLHttpRequest。这到底是怎么回事呢? Web 2.0 一瞥 在深入研究代码之前首先看看最近的观点 —— 一定要十分清楚 Web 2.0 这个概念。听到 Web 2.0 这个词的时候,应该首先问一问 “Web 1.0 是什么?” 虽然很少听人提到 Web 1.0,实际上它指的就是具有完全不同的请求和响应模型的传统 Web。比如,到 Amazon.com 网站上点击一个按钮或者输入搜索项。就会对服务器发送一个请求,然后响应再返回到浏览器。该请求不仅仅是图书和书目列表,而是另一个完整的 HTML 页面。因此当 Web 浏览器用新的 HTML 页面重绘时,可能会看到闪烁或抖动。事实上,通过看到的每个新页面可以清晰地看到请求和响应。 Web 2.0(在很大程度上)消除了这种看得见的往复交互。比如访问 Google Maps 或 Flickr … More AJAX核心对象– XMLHttpRequest 对象使用详解 (一)

Insert post via Frontend

<?php /** * post-process.php * make sure to include post-process.php in your functions.php. Use this in functions.php: * * get_template_part(‘post-process’); * */ function do_insert() { if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘post_type’] == ‘book’ ) { // Check what the post type is here instead // Setting the ‘post_type’ => $_POST[‘post_type’] in … More Insert post via Frontend

How to show the Exact searh result in Magento

If you want to show the exact search reuslt for your products Two things need to be changed 1) In admin system->configuration->catalog->catlogsearch->Search Type Make it as Like 2)Just copy the fulltext.php file in local folder as given app/code/local/Mage/CatalogSearch/Model/Resource/Fulltext.php and just replace the above code foreach ($words as $word) { $like[] = $helper->getCILike(‘s.data_index’, $word, array(‘position’ => … More How to show the Exact searh result in Magento

How to add Currency selector to Magento’s header

Since Magento has built in functionality for currencies, it shouldn’t be too hard to create custom currency selector and put it to the header. You might say this tutorial is for beginners, since it’s pretty much straightforward. You might have noticed the ”Currency Setup” tab in Magento’s Administration under “System->Configuration” menu. There you should select default site … More How to add Currency selector to Magento’s header

How to Install mcrypt PHP extension on CentOS Virtualmin

The default installation of virutalmin doesn’t come with additional PHP extensions which some php scripts may need, you have to manually install each php extension compare with easyapache from cPanel which you can install all at once. Add centOS repo For CentOS 5 rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm For CentOS 6 rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm yum install php-mcrypt … More How to Install mcrypt PHP extension on CentOS Virtualmin

New WordPress Power Tips For Template Developers And Consultants

It has been a big year for WordPress. If there were still some lingering doubts about its potency as a full-fledged content management system, then the full support forcustom taxonomies and custom post types in WordPress 3.0 core should have put them to rest. WordPress 3.1 took those leaps one step further, polishing custom taxonomies with multi-taxonomy query support, … More New WordPress Power Tips For Template Developers And Consultants