Magento add shipping rates for weight based on zip code/postal code

Are you using magento store? You want to add shipping rates for the items based on the zip code/postal code ? Then you’re in the right place. Here I’m going to show how to add shipping rates based on user selected country.
I imagine you in your store, user will enter the zip code manually. Also you can auto populate the zip code after user selected the city in drop down box for your country.I’ll explain this method in my next post.
Let’s start.
Continue reading Magento add shipping rates for weight based on zip code/postal code

WordPress save youtube or vimeo thumbnail as featured image

How to save youtube or vimeo thumbnail as featured image of wordpress post.For a examaple if you add the video url as custom meta data or post content you need to get it’s video thumbnail and save it as featured image automatically.
This post is discussing how to save youtube vimeo thumbnail as featured image in wordpress post or page or custom post types.

Continue reading WordPress save youtube or vimeo thumbnail as featured image

Correct and easy way to install the yii Framework

There are couple of php frameworks now.Mostly CodeIgniter,yii,Zend,Cakephp,Symfony,Laravel, and too many. You can see the details from “phpframeworks.com“. I’m going to tell about the yii framework.Lot of users have problems how to correctly install the yii framework application.In the official yii framework site’s video is not showing clearly install the app. I’m going to show how to do it correct and secure way.
Continue reading Correct and easy way to install the yii Framework

WordPress 4.2 and earlier vulnerable issues found !

The vulnerability allows an attacker to inject JavaScript in the WordPress comment field; the comment has to be at least 66,000 characters long and it will be triggered when the comment is viewed.
Date:- April 27th, 2015.
Continue reading WordPress 4.2 and earlier vulnerable issues found !

PHP best & secure user registration with login example

This example is explaining how to create secure user registration using php and mysql.This is very secure using salt value into database users table.It help to avoid sql injection and dictionary attack from hackers. This way is secure and better than md5 encryption method.
Here tested code.
This is have two parts.
1-User Registration
2-User Login

sql-injection

Continue reading PHP best & secure user registration with login example

Get store url of wordpress clipper theme

If you’re familiar with wordpress coupon site you may had use the wordpress clipper theme as parent theme.Also discounty theme is a child another theme use with clipper theme.So when we’re customize the theme you want to get store url using coupon ID/post ID.This post is showing how to get easily store url using post ID.
Continue reading Get store url of wordpress clipper theme

WordPress remotely publish post using XML-RPC

Today I’m going to show how to remotely publish post using xml-rpc of the wordpress.This is actually very simple and powerful.If you want to publish posts or pages without log into the wordpress admin panel you can use this method.First we’ll consider what is this XML-RPC and it’s usages.

Continue reading WordPress remotely publish post using XML-RPC

wordpress sort custom post type columns

When you’re creating custom post types into your wordpress site you can see it’s posts as list.But there is no option to sort each columns.You have to manually add this facility to do this.I’ll describe here very simply how to do this without any plugin.
Continue reading wordpress sort custom post type columns

WordPress restrict access to custom post types for user roles

If you’re creating custom post types to wordpress site sometimes you need to restrict access to custom post types from back-end to other users. For a example if you created the custom post type named “Campaigns” and you want to enable that “Campaigns” page from admin panel only administrator user role.To do this I’ll show very simple method by explaining from start to end.Hope every users can understand easily. Continue reading WordPress restrict access to custom post types for user roles

WordPress create custom post types with tags and categories

If you’re working with wordpress sometimes you want to add custom post types with it’s tags and categories to add into admin panel.For a example, “News” custom post type.You can follow this tutorial guide to add unique custom post types with it’s tags and categories to admin panel.No errors,no tags and categories mixing with other post types.No usages of plugins.

Features

  • Unlimited Custom post types
  • No mixing with other post types
  • Creating unique tags and categories
  • No usages of plugins
  • Simple and efficient code
  • Customize display columns
  • Custom admin menu icon
  • Sort column by post name
  • Filter posts by categories

Now we’ll see how to add custom post type to wp admin panel.
-First you must go to the theme folder and open the functions.php file.If you’re using premium themes you can use custom-functions.php or theme-function.php.
-After that at the end of the file put the following piece of code.Here I’m using “News” custom post type.

 

Step-1

After add the above code you can see the changes as following.

custom post types

Further note:
If you want to add custom menu icon go to following link and select the icon.Then copy it’s name(Ex:-dashicons-format-aside) and put here.
Dashicons

Step-2

Main part is finished.Now we’ll add it’s categories.Note here,I’ll explain little bit mistake many user’s doing.
If you add following mentioned code, you can see categories mixing with other post type’s,default post’s categories.So DON’T USE Following code. ‘taxonomies’ => array(‘category’) ,// mixing with others.

This is the correct code.

 

Step-3

Now we have to do the customize columns as the following diagram.
custom post types columns

Add the following code to functions.php file.

 

Step-4

Filter news and sort by name.
To do that add this code.

 

Step-5

Adding Tags to Custom post type. You can add following code to add tags to News post types.No mixing with other post types.

Now you have implemented all codes and after that you can see custom post types with tags and categories,sorting,filtering functions.
custom post types all

Error fixing

May be when you visited to the category page you may not be seen the post related to that category. To fix this add the following code to function.php file.

Additional Notes

If you want to add more admin menu icons then add this code to functions.php file.

Follow my another post describing this.

Download full source code

WordPress find specific shortcodes from post & page contents

How do you find specific shortcode from the wordpress page or post contents? For a example if you are using “gallery” shortcode, you want to check that code if exist or not for some modifications.I wanted this for gallery shortcode if exist for some gallery width changes.So I found some codes and I have improved php codes and implementing here to you.
Continue reading WordPress find specific shortcodes from post & page contents

WordPress get woocommerce featured products

In the wordpress woocommerce web site’s contains various featured products and sometimes we want to get the featured products without any plugins.For a example we want to get featured products to create featured slider.So I’m going to tell you have to get woocommerce featured products without any plugins and grammatically.

Continue reading WordPress get woocommerce featured products

WordPress create custom post types/taxonomies

Custom Post Types are a new set of administrative options appearing along with the default post types such as Posts, Pages, Attachments etc. A Custom Post Type can store any type of information. It has a editor, media uploader and uses the existing WordPress table structure for ease in data management.

By default, WordPress comes with 3 taxonomies:post tag, categories and link categories. Essentially, a taxonomy is a way of classifying data. Continue reading WordPress create custom post types/taxonomies

WordPress create custom meta boxes

This post is explaining creating wordpress custom meta boxes/meta data in easy,secure & proper way.A post meta box is a draggable box shown on the post adding/editing page. Its purpose is to allow the user to enter information in addition to the main post content.

There are two types of meta boxes. Continue reading WordPress create custom meta boxes

WordPress get recent post except first 3 posts

How to check and get recent post 3 in wordpress? On another way it’s calling exclude posts.I’m going to explain this in 2 methods.First method is getting first 3 posts into an array. When we’re going to display the posts, checking current post ID if exist in that array. If exist continue the loop.If not exist then display the posts.Other method is passing parameter “offset”.
Continue reading WordPress get recent post except first 3 posts