Posts

Showing posts from 2014

Add product categories to menu in woocommerce

Image
WordPress comes with a wonderful and easy to use menus functionality, letting you quickly create a custom menu and place it in your theme’s supported menu areas or even in a widgetized area with the menus widget. By default WordPress, and our themes, will start by adding all of your pages to the default navigation menu. You can then  customize your menu in all our themes by going to  Appearance > Menus . WordPress Menus Location

Add Variable products in woocommerce

Image
Variable products  are a great feature of WooCommerce for offering variations of a product with different prices, stock and more. They can be used for offering variations of a product e.g. a large t-shirt vs a small t-shirt. Each variation can have different properties and prices. Adding attributes for variations Set the product type To add a variable product first selection the type ‘ variable ’ from the product type dropdown. The interface will change to reflect your selection. Choose the variation type Define variation attributes On the attributes tab add some attributes to your product – you can use global attributes (see  Managing Product Categories, Tags and Attributes ) or define some custom ones specific for your product. Add your attribute to the product Make sure to assign all values of the attribute to the variable product which will become options and check the ‘variation’ checkbox on each attribute to tell WooCommerce its for your variations: Add at

Send email by using codeigniter library via localhost

function sendMail () { $config = Array ( 'protocol' => 'smtp' , 'smtp_host' => 'ssl://smtp.googlemail.com' , 'smtp_port' => 465 , 'smtp_user' => 'xxx@gmail.com' , // change it to yours 'smtp_pass' => 'xxx' , // change it to yours 'mailtype' => 'html' , 'charset' => 'iso-8859-1' ,

form validation rules in CodeIgniter

<? php class Form extends CI_Controller { public function index () { $this -> load -> helper ( array ( 'form' , 'url' )); $this -> load -> library ( 'form_validation' ); $this -> form_validation -> set_rules ( 'username' , 'Username' ,     'callback_username_check' ); $this -> form_validation -> set_rules ( 'password' , 'Password' ,     'required' ); $this -> form_validation -> set_rules ( 'passconf' ,     'Password Confirmation' , 'required' ); $this -> form_validation -> set_rules ( 'email' , 'Email' ,     'required|is_unique[users.email]' );  

Pagination with CodeIgniter

The Model models/ model_page_name .php class class_name extends CI_Model {     public function __construct() {         parent::__construct();     }     public function record_count() {         return $this->db->count_all("table_name");     }

Protect Your WordPress Site From Hackers

1. Delete the username “admin”   The default username when creating a WordPress site is “admin.” Most people keep this username. This makes it dead easy for hackers to guess your username. Then they are already half logged in to your site. So delete any account with the username “admin.” Note: if the account with username “admin” is the only user that currently has Administrator-level access, you won’t be able to delete it until you first create and login with a different Administrator-level account. WordPress needs to ensure that there is some way to access Administrator functions for your site.

send email with attachment in php

Use the phpmailer class to add attachments function emailWithAttachment ( $to , $subject , $message , $attachment )   { $mail = new PHPMailer (); $mail -> AddAddress ( $to ); $mail -> From = "your@email.com" ; $mail -> FromName = "Your Name" ; $mail -> Subject = $subject ; $mail -> Body = $message ;

PayPal integration in PHP

Just follow some step and PayPal integration is ready to use. You need one test account for test this method. If you have already test account so use it. Otherwise create new from  www.developer.paypal.com and signup. After complete your PayPal test account follow this code for your PayPal integration.      1.      Create Form for send payment Paypal.php <?php include "../wp-config.php"; $paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; // Test Paypal API URL

How to Manually Reset WordPress Admin Password

Image
Step 1: Login to your cPanel and Select PHPMyAdmin Click on the PHPMyAdmin Icon in your cPanel.

WordPress Admin Page Hacks

1. How to Disable Dragging of Metaboxes in the Admin panel To stop users from dragging metaboxes around the admin area and dashboard just add the following code in your to  functions.php  in your theme folder. function disable_drag_metabox () {     wp_deregister_script ( 'postbox' ) ; } add_action ( 'admin_init' , 'disable_drag_metabox' ) ;