Category Archives: Opensources

What is a WordPress Child theme & how to customize WordPress Theme using WordPress Child theme?

We all know that a WordPress theme is a collection of template files which lets us change the user interface, design, look & feel of the site.

 

Have you created WordPress theme or have installed any free theme or commercial one, many of you have done this job and have also customized but the problem is created when you have customized the original theme files and the update of that theme is available and you never would like to update as your customization will get destroyed if you update that, but my recommendation is that you should always keep your plugins and themes updated to the latest version. So you should take care during the customization and never do the customization in original file and should create a child theme. But what does that mean, and how do you do it?

 

In WordPress 3. 0 or latest versions a new concept was added by WordPress core team and community named as “Child Theme”.

 

As per the WordPress Codex definition of Child Theme:

 

“A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme. 

Child theme allows you to modify, or add to the functionality of that parent theme. A child theme is the safest and easiest way to modify an existing theme, whether you want to make a few tiny changes or extensive changes. Instead of modifying the theme files directly, you can create a child theme and override within. “

 

How to work with WordPress Child Theme?

 

Let’s take an example; I’ll create a child theme for WordPress default ‘Twenty Twelve’ theme.

1) So in this case, to create a child theme, I have to create a new directory alongside the ‘Twenty Twelve’ theme’s directory called twentytwelve-child.
“twentytwelve-child” directory should be in parallel of original theme twentytwelve.

2) Create a style.css file under the ‘twentytwelve-child’ theme directory.

Put the below text in style.css file

/*
Theme Name:     Twenty Twelve Child
Theme URI:      http://wp. tutsplus.com/
Description:    Child theme for Twenty Twelve
Author:         Japh
Author URI:     http://wp. tutsplus.com/author/japh
Template:       twentytwelve
Version:        1. 0. 0
*/

// This @import line loads the stylesheet of parent theme
@import url('. . /twentytwelve/style.css');

//Theme customization starts here

There are two important parts here to notice:

Template: twentytwelve
It tells WordPress that this theme is a child theme of the ‘Twenty Twelve’ theme

@import url(“. . /twentytwelve/style.css”);
It loads the parent theme’s (twentytwelve in this case) style.css as a starting point

3) Now you can log into your WordPress dashboard and see your ‘Twenty Twelve Child’ theme there, and activate it.

4) Make further alterations & addition and you will found that these will automatically reflected on your website.

 

Just Done!!

 

Now always keep in mind that whenever you want to make a customization to your theme, does it in your child theme.

Files in your child theme override files of the same name in the parent theme. So any file from your parent theme you want to change, copy to your child theme & make your modifications there.

The same goes for any templates that may not be in your parent theme. You can add them in your child theme, and WordPress will use them.

One exception to these rules is the functions.php file. In this case, the functions.php file for the child theme is loaded first, followed by the functions.php file of the parent theme. So there’s no need to copy the functions.php file from the parent into the child, just start fresh in the child theme for that one.

This allows the child theme to have all the functionality from the parent theme. Parent themes can also make their function pluggable, which allows a child theme to override them.

 

Why should you use WordPress Child Themes?

 

1. Safe Updates

A child theme automatically inherits the parent theme’s features, styles, and templates. This allows you to make changes to your site using child themes without ever modifying the parent theme. When a new version of the parent theme available, you can safely update it as you know that all your modifications are saved in the child theme.

 

2. Easy to Extend
A child theme built on a powerful theme framework allows a great deal of flexibility without writing a lot of code. You can selectively modify only the template files and functions that you need without going through other template files. You can add new functionality and much more.

 

3. Fall-back Safe
When you are creating a complete theme you need to think about all the possible scenarios and code for them. However, when you are working on a child theme and you forget to code for something, then there is always the parent theme’s functionality available as the fallback option.

 

WordPress catchable Tools for Child Theme

 

One-Click Child Theme plugin built and tested for the latest WordPress 3.x version.It adds a menu link into your Admin “Themes” section to automatically build a child using your currently active theme.This is fantastic if you don’t want to mess with FTP and are looking to play around with some new ideas.You can also use Child Themify plugin for creating the child themes.

 

If you plan to edit these files within the admin panel you’ll also enjoy clearer syntax highlighting for that you can install the Advanced Code Editor for some much-improved functionality. This makes wading through PHP code blocks and HTML/CSS a whole lot more manageable.

 

Additional Resources & references

 

1. http://wp.tutsplus.com/tutorials/theme-development/child-themes-basics-and-creating-child-themes-in-wordpress/

2. http://www.hongkiat.com/blog/wordpress-child-themes-dev/

 

Hope this all helps.

 

PHP: How to enable rewrite_mod in WAMP

Have a look on below Image and follow the steps to make “rewrite_mod” on WAMP server.

 

enable-rewrite_mod-wamp

 

You all know WAMP stands for (Windows, Apache, MySQL, PHP), It is package provide you an environment to execute your PHP application.

 

But the general issue you have faced with WAMP is, your rewrite rules usually not work i.e. .htaccess file is not read by Apache server (in WAMP) or give you error “Internal Server Error”.

 

You have to follow 2 simple steps to troubleshoot and fix the issue.

 

1) If you have installed WAMP on your system, then you can find a small icon in your task bar bottom right corner.

 

2) Click on that, you will see a menu as above

Go to
=>Apache
=>Apache Modules
=>click on rewrite_module
Check/tick marks that option, if you find it checked already that means it’s already enabled.

Save

Search Engine Spider and User Agent Identification with “Ultimate User Agent Blacklist”

Search Engine Spider and User Agent Identification with “Ultimate User Agent Blacklist”

 

A user-agent is software (a software agent) that is acting on behalf of a user.
In many cases, a user-agent acts as a client in a network protocol used in communications within a client–server distributed computing system.

 

For more information view wiki
http://en.wikipedia.org/wiki/User_agent

 

Automated Agents is called as Bots.
http://user-agents.org has a complete list of all latest spiders/bots/user agents.
There are some more and those are anonymous (not known and have very different names).

 

If you develop a website and want to make the site accessible by some specific user agent or bots of a country, then you can update the information in your root .htaccess file.

 

As, Bot blocking blacklists are useless in some way as some rogue spiders just generate random user-agent strings so we will never have them in our list to start with, but We have tried list out as much as we can in the below zip file.

 

Ultimate User Agent Blacklist

 

What you have to done is, unzip the file and paste the code in your root .htaccess file, it will protect your website from unwanted crawling/indexing by anonymous bots.

 

If your website uses WordPress open-source, then can also use “Better WP Security” plug-in.
Just need to download and install the plug-in and go to “Better WP Security – Ban Users” Tab and enable “Enable Default Banned List”, you can also update the list according to your needs.

 

But please be careful before doing same, as it may affect your website’s core files and plug-in, So before doing this backup your website’s files and database.

 

Disable All WordPress Updates Notifications

First of all, there is no benefit of disabling plugin updates.

 

It is very important as I have previously said in the posts that you should keep your WordPress version as well as plugins up to date. If you don’t keep, then your site could be susceptible to security vulnerabilities or performance issues.

 

But as we are developers like this ability because we do not want the clients to upgrade a plugin himself (If it may breaks the site :-)) although this is not a good reason.
We are potentially risking security, performance, and additional features all because of a fear that the site will break down due to an upgrade, it’s bad it’s it?

 

Another reason that developers disable plugin updates is if they have customized the core files. You can also use a plugin like WP Manage plugins which allows you to disable plugin updates for specific plugins.

 

But if you want to hide all the updates related notifications, just all the below codes in your theme’s “functions.php” file.

 

<?php

//Disable WordPress Theme Updates 3.0+
remove_action( ‘load-update-core.php’, ‘wp_update_themes’ );
add_filter( ‘pre_site_transient_update_themes’, create_function( ‘$a’, “return null;” ) );
//Un-schedule all previously-scheduled cron jobs for WordPress themes versions/updates check
wp_clear_scheduled_hook( ‘wp_update_themes’ );

 

//Disable WordPress Plugin Updates 3.0+
remove_action( ‘load-update-core.php’, ‘wp_update_plugins’ );
add_filter( ‘pre_site_transient_update_plugins’, create_function( ‘$a’, “return null;” ) );
//Un-schedule all previously-scheduled cron jobs for WordPress plugin versions/updates check
wp_clear_scheduled_hook( ‘wp_update_plugins’ );

 

//Diasable WordPress Core Updates 3.0+
add_filter( ‘pre_site_transient_update_core’, create_function( ‘$a’, “return null;” ) );
//Un-schedule all previously-scheduled cron jobs for wordpress versions/updates check
wp_clear_scheduled_hook( ‘wp_version_check’ );

?>

PHP: Choose The Best Shopping Cart Software

PHP: Open Source E-Commerce Shopping Carts Software

Choosing right shopping cart software is one of the most crucial steps to making your on-line business successful.

 

A customer always needs to be able to purchase products as easily as possible, with a sense of security.

 

A business owners always choose software that should be simple to use with useful features and great customer support whenever needed and some marketing related tools.

The following are the general criteria that are generally used to evaluate the best shopping cart software.

 

Web Design

The design features of shopping cart software should include an array of design templates to choose from and step-by-step wizards or WYSIWYG editors for storefront development. The templates should be easy to use and should offer customization options that enable you to create the perfect site for your business.

 

Administration & Inventory Control

Shopping cart software includes a range of administrative features that allow you to manage your inventory. An administrative dashboard provides access to product upload, editing and management options. The best shopping cart software applications allow you to upload an unlimited number of products and sell both hard (physical) and soft goods (services or downloadable products, such as software).
Beyond inventory control, the best shopping cart software offers comprehensive payment options and integration with accounting software.

 

Marketing

Shopping cart eCommerce software should include robust marketing tools to help you generate more traffic to your site and thus increase sales. For instance, you should be able to automate abandoned cart emails, offer daily deals and implement a loyalty program for your shoppers. Additionally, the software should allow you to run detailed sales reports so that you can easily identify your best – and worst – selling products.

 

Security

Security is a chief concern for online shoppers, so it’s crucial to make sure that the shopping cart website you use offers standard security features. These should include fraud protection, SSL secure checkouts that encrypt customers’ payment information, as well as data backup and restoration to protect your business records.

 

Help & Support

The manufacturers of top-notch shopping cart software provide comprehensive support resources that you can reference, including a knowledge-base, community forums and video tutorials. The manufacturer should also provide direct technical assistance via email or telephone.

 

According to these criteria and popularity I am sharing the 10 Best Open Source Shopping Carts.

 

You can also view the popularity on Wikipedia link as below.
http://en.wikipedia.org/wiki/Comparison_of_shopping_cart_software

 

1) Magento

magento-logo

Magento is a feature-rich eCommerce platform built on open-source technology that provides online merchants with unprecedented flexibility and control over the look, content and functionality of their eCommerce store. Magneto’s intuitive administration interface features powerful marketing, search engine optimization and catalog-management tools to give merchants the power to create sites that are tailored to their unique business needs.

 

See more
Front: http://demo.magentocommerce.com/
Admin: demo-admin.magentocommerce.com/index.php
Username: admin Password: 123123

 

2) Prestashop
prestashop-logo

Prestashop is an award winning e-commerce solution having won the Best Open Source Business Application. Having been distributed under the open source license, Prestashop now powers thousands and thousands of online stores across the globe. It is also backed by an active community of developers who frequently develop various add-ons for extending the functionalities of Prestashop. Currently, PrestaShop has around 275 e-commerce features that make online business an easier and simpler affair for online merchants.

 

See more
Front: http://demo-store.prestashop.com/en/
Admin: http://demo-bo.prestashop.com/demo/index.php?controller=AdminLogin&[email protected]
Username: [email protected] Password: prestashop_demo

 

3) Open cart
opencart-logo

OpenCart is an open source PHP-based online shopping cart system. A robust e-commerce solution for Internet merchants with the ability to create their own online business and participate in e-commerce at a minimal cost. OpenCart is a turn-key ready “out of the box” shopping cart solution. You simply install, select your template, add products and you’re ready to start accepting orders.

 

See more
Front: http://demo.opencart.com/
Admin: http://demo.opencart.com/admin/
Username: demo Password: demo

 

4) VirtueMart
virtuemart-logo

VirtueMart is an Open Source E-Commerce solution to be used together with a Content Management System (CMS) called Joomla!. Joomla! and VirtueMart are written in PHP and can be used in typical PHP/MySQL environments. Viruemart is not developed by Joomla!, however its works perfectly with it and blends seamlessly with Joomla!. If you would like to read more then here is an article which VirtueMart – A Perfect Ecommerce Platform for Joomla!

 

See more
Front: http://virtuemart.net/features/demo
Admin: http://demo.virtuemart.net/administrator/
Username: demo Password: demo

 

5) OSCommerce
oscommerce-logo

OSCommerce is an online shop e-commerce solution that offers a wide range of out-of-the-box features that allows online stores to be setup fairly quickly with ease, and is available for free as an Open Source based solution. Today, osCommerce has been taken to the next level, moving towards an e-commerce framework solution that not only remains easy to setup and maintain, but also making it easier for store administrators to present their stores to their customers with their own unique requirements.

 

See more
Front: http://demo.oscommerce.com/

 

6) Zen-cart
zencart-logo

ZenCart truly is the art of e-commerce; free, user-friendly, open source shopping cart software. The ecommerce web site design program is being developed by a group of like-minded shop owners, programmers, designers, and consultants that think ecommerce web design could be and should be done differently. ZenCart offers great support and tutorials and has extensive documentation to help you at every stage.

 

See more
Front: http://www.15.zen-cart-demo.com/
Admin: http://www.15.zen-cart-demo.com/
Username: admin Password: password123

 

7) UberCart
ubercart-logo

Ubercart is an exciting open source e-commerce shopping cart that fully integrates your online store with Drupal, the leading open source content management system. This is a killer combination for anyone looking to build a community around a product, sell access to premium content, offer paid file downloads, and much much more!

 

See more
Front: http://www.ubercartdemo.com/
Admin: http://www.ubercartdemo.com/user/login
Username:demo Password: demo

 

8) Xcart
x-cart-logo

X-Cart or XCart is a PHP/MySQL based secure shopping cart software that uses Smarty template engine for easy and unlimited design creation. X-Cart is template based software with open source code. This means you can modify the look & feel and functionality of the shopping cart the way you need should you require any business specific features.

 

See more
Front: http://demo.x-cart.com/demo/home.php
Admin: http://demo.x-cart.com/demo/admin/
Email: [email protected] Password: master

 

9) Miva Merchant
miva-merchant-logo

Miva Merchant is a mature and robust e-commerce storefront solution with the usual sorts of e-commerce functionality. It allows you to create and manage an e-commerce catalogue, handle payments and shipping – as well as Inventory and Merchandising capabilities.

 

See more
Front: http://www.mivamerchant.com/products/demo/mm5/merchant.mvc?Screen=SFNT&Store_Code=Miva_fresh_2
Admin: http://www.mivamerchant.com/products/merchant/mm5/admin_demo.html
Username: demo Password: demo

 

10) CubeCart
cubecart-logo

CubeCart is a complete ecommerce shopping cart software solution. With CubeCart you can quickly setup a powerful online store to sell digital or tangible products to new and existing customers globally. CubeCart is one stop shop solution for everyone, whether you are a retailer or a web developer, you can install CubeCart and get your ecommerce store running in minutes.

 

See more
Front: http://demo.cubecart.com/cc5/
Admin: http://demo.cubecart.com/cc5/admin.php
Username: admin Password: password

 

Save

How to move your wordpress site to a new domain – easy wordpress migration

WordPress stores the URL in his database, one of my colleague is new bie for WordPress.He has developed a new WordPress site and client has given all the data to him.After making the full site ready, he get stuck that four most important tables have URL in it, so should all the data need to re-enter by WordPress admin.

 

I know most of the WordPress newbie think like this, but it can be done by below eight very simple queries (in the case if you have not installed any large plugins)

 

What you need to done is just replace
@old-wp-url@ and @new-wp-url@ as per your website and run these query.

 

UPDATE wp_options SET option_value = REPLACE (option_value, “@old-wp-url@”, “@new-wp-url@”) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

 

UPDATE wp_posts SET guid = REPLACE (guid, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_posts SET post_content = REPLACE (post_content, CONCAT(‘src=”‘, “@old-wp-url@”), CONCAT(‘src=”‘, “@new-wp-url@”));

 

UPDATE wp_posts SET guid = REPLACE (guid, “@old-wp-url@”, “@new-wp-url@”) WHERE post_type = ‘attachment’;

 

UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_links SET link_url= REPLACE (link_url, “@old-wp-url@”, “@new-wp-url@”);

 

UPDATE wp_links SET link_image = REPLACE (link_image, “@old-wp-url@”, “@new-wp-url@”);

 

Now move your WordPress site to a new domain is very simple, isn’t it!!

If you still face any issue, post your comments.