In this artcle we will learn how to save and show a custom field as order item meta in woocommerce. Here I suppose to save a COLOR custom field with each of order item in woocommerce.
Add woocommerce product title to all product images alt tags
I have put a working code which force to add custom value for your product images. You can set ATL value as per your need. It might be like your product title or product category name + Product Title whatever combination you want.
Fix: Fatal error: Allowed memory size – Increase PHP Memory
If you are working with WordPress site then you had faced this issue many time. This is common issue of WordPress. Sometimes any piece of code takes enough time to execute and due to this WordPress requires more memory than allocated .
How to change UTC time to your local time using PHP
How to change UTC time to your local time using PHP is big question in PHP programming language. Today, PHP Tricks provide you a simple and quick function to covert UTC/GMT time to your local time using DateTimeZone PHP class.
How to Use Shortcodes in WordPress Sidebar Widgets
In this article, I elaborate how to Use Shortcodes in WordPress Sidebar Widgets. I proposed two methods to do this in simplest way. Go through the article and leave your comment.
Smooth scrolling between sections of Web page using jQuery
This jQuery codehelps you add smooth SCROLL animation when you click to Go To link in your web page. I am using .animate jQuery function in following code. In this tutorial you will learn how you can create an animated scroll to top or any element with jQuery. Create Button or Link First we need… Continue reading Smooth scrolling between sections of Web page using jQuery
Get next seven days list from Today using PHP
A PHP function that helps to get list of next days form current day. There are many way but I created one of best solution using foreach and strtotime in-built PHP functions.
Browse/Upload button Validation using Javascript
Here you can learn how to add client side validation on Browse/Upload button. JQuery helps a lot to add such type of client side validation on HTML DOM.
How to fix blank page error in Magento
Getting blank page or dead white page is big issue with Magento. So PHP Tricks provide you easy function to avoid blank page error in your Magento site.
Create random strings in PHP
I made a PHP function which returns a random string using Alphabets [a to z] and [A to Z], Numbers [0 to 9]. It is very easy to use and can be easily modified.
Get custom posts based on meta field content
To get posts on basis of their meta content, You can use get_posts function as given below:
Redirect to custom URL after adding Comment – WordPress
A function that helps you to redirect to any custom page after posting WordPress comment. WordPress provides many filters to do this custom redirection. Few of tricks are explaining in this article .
How to add metaboxes for custom post types – WordPress
Here In this article, You will know how to add metaboxes for Custom posts in write screen inside WordPress admin section. WordPress provides some functions to add a section where you can manage your additional content of post. In this example, I am adding a metabox as name “Images” under my custom post (lets consider post type is… Continue reading How to add metaboxes for custom post types – WordPress
Add a new style to your WordPress Comment Form
Apply additional Style in WordPress Comment Form In this trick, You get many name of classes where you can add additional style/CSS to override default styling of Comment form. WordPress allows you to add CSS to get new look of Comment section in posts/pages. The WordPress comment form is generated using the function <?php comment_form();… Continue reading Add a new style to your WordPress Comment Form
Easy way to show author details in WordPress
The image that shows for the author comes from the email address set for that user which goes to a corresponding Gravatar. The display name and bio come from the User settings area in the Admin.
How to add Category Name as class(s) in body tag
The body_class wordpress filter is nice for adding a lots of classes to the body tag that have information about what kind of page is currently being displayed. Probably for styling purposes. But for whatever reason, it doesn’t include a class for the current category (or categories) for a single post. This following code adds all… Continue reading How to add Category Name as class(s) in body tag
Get URL Variables
PHP Tricks provide a function which helps to get URL parameters using JavaScript. This is very easy function to quick edit.
Get URL parameters using jQuery
jQuery code snippet to get the dynamic variables stored in the url as parameters and store them as JavaScript variables ready for use with your scripts. Used differently to Hash Url’s as the world turns to dynamic web apps. Thus things like Decoding URL Strings will be ever popular for years to come.
PHP Login Script with Remember Me functionality
In a login script, remember me feature is used to preserve the login name and password entered by the user. And it can be populated in the login form at the time of login. It minimizes the user effort by preventing to enter login details for each time. Now we are going to see an… Continue reading PHP Login Script with Remember Me functionality
Add PHP page/template in WordPress
An article which helps you to add Template page in your WordPress website.We can start with a sample file and copy page.php, rename it on your choice and put it inside the theme folder ../wp-content/themes/mytheme/ .