3 Good code for WooCommerce Store

  1. Clear cart: Sometimes we want to add clear cart button on checkout or any other step in that case below code is helpful. In this we just need to pass a parameter in URL. Here you can set any url depends on you. You can redirect the customer on Home page or any other page too.

Please pass action parameter with clear value to execute the below code. Paste this code in functions.php of theme.

add_action( ‘init’, ‘woocommerce_clear_cart_url’ );

function woocommerce_clear_cart_url() {

  global $woocommerce;

   if (isset( $_GET[‘action’] ) ) {

          if ($_GET[‘action’] ==’clear’ )  {

          $woocommerce->cart->empty_cart();

                   }

    }

}

  • Disable Zoom effect on single product page:

WooCommerce have own code to zoom image on mouseover. If want to disable that then use below code in functions. php

add_filter( ‘woocommerce_single_product_zoom_enabled’, ‘__return_false’ );

  • Disable the Shipping option from checkout

WooCommerce has 2 addresses. First one is Billing address and Second is Shipping Address. Few websites uses same address for Billing and Shipping as they do not deliver any physical good. So below code is helpful for those users. Paste below code in functions.php to disable the shipping address from checkout of woocommerce.

add_filter( ‘woocommerce_cart_needs_shipping_address’, ‘__return_false’);

Anti-Spam plugin for WordPress

Why we need anti-spam plugin

If you are using WordPress blog or website then sometimes you get an irrelevant or malicious comment in your blog post. Sometimes you get lots of same comments with same email ID. So anti-spam plugin used for this.

What plugin is good and free

Akismet is the most powerful anti-spam plugin for WordPress. It filters the spam comments, which is a more important thing for any blogger. It checks all your comments for irrelevant and malicious comment and removes them.

It’s a simple and affordable plugin.

You can use it free too. You need an API key to activate that too.

You can get an API key here.

Built-In Shortcode in WordPress

WordPress is most user friendly CMS. It provides already few built-in shortcode. So to embed these shortcode you don’t need any plugins. WordPress already provides functionality for the following shortcode.

Here are built-in shortcode.

WordPress Multisite

A multisite network is a collection of websites that all share the same WordPress installation. They can also share plugins and themes. The individual sites in the multisite network are virtual websites in the sense that they do not have their own directories on your server, although they do have separate directories for media uploads within the shared installation, and they do have separate tables in the database.

You can use subdomains or subfolders for multisite.

To enable the Network setup menu item, just need t add below one line code in wp-config.php.

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

For more information please click here

How to add new user in WordPress with Administrator Level using code in functions.php

This is a basic requirement for some developer. Just copy and paste below code and replace the appropriate details like username, email and password in functions.php. After that just run the website.

add_action('init', 'add_my_user');
function add_my_user() {
    $username = 'Username Here';
    $email = 'Email ID Here';
    $password = 'Password Here';

    $user_id = username_exists( $username );
    if ( !$user_id && email_exists($email) == false ) {
        $user_id = wp_create_user( $username, $password, $email );
        if( !is_wp_error($user_id) ) {
            $user = get_user_by( 'id', $user_id );
            $user->set_role( 'administrator' );
        }
    }
}

WordPress 4.3 Beta 3 is now available

WordPress 4.3 Beta 3 is now available!

This software is still in development, so we don’t recommend you run it on a production site. Consider setting up a test site just to play with the new version. To test WordPress 4.3, try the WordPress Beta Tester plugin (you’ll want “bleeding edge nightlies”). Or you can download the beta here (zip).

For more information about what’s new in version 4.3, check out the Beta 1 and Beta 2 blog posts. Some of the changes in Beta 3 include:

  • Performance improvements for Menus in the Customizer, as well as bug fixes and visual enhancements.
  • Added Site Icon to the Customizer. The feature is now complete and requires lots of testing. Please help us ensure the site icon feature works well in both Settings and the Customizer.
  • The improvements to Passwords have been added to the installation flow. When installing and setting up WordPress, a strong password will be suggested to site administrators. Please test and let us know if you encounter issues.
  • Improved accessibility of comments and media list tables. If you use a screen reader, please let us know if you encounter any issues.
  • Lots and lots of code documentation improvements.
  • Various other bug fixes. We’ve made more than 140 changes in the last week.

WordPress 4.2.2 fixes

WordPress 4.2.2 fixes a cross-site scripting vulnerability contained in an HTML file shipped with recent Genericons packages included in the Twenty Fifteen theme as well as a number of popular plugins by removing the file. Auto-updates and manual updates will remove this file, however manual installations and those using VCS checkout (like SVN) will not remove this file. Version 4.2.2 also improves on a fix for a critical cross-site scripting vulnerability introduced in 4.2.1.

The release also includes hardening for a potential cross-site scripting vulnerability when using the Visual editor.

In addition to the security fixes, WordPress 4.2.2 contains fixes for 13 bugs from 4.2.1, including:

  • Fixes an emoji loading error in IE9 and IE10
  • Fixes a keyboard shortcut for saving from the Visual editor on Mac
  • Fixes oEmbed for YouTube URLs to always expect https
  • Fixes how WordPress checks for encoding when sending strings to MySQL
  • Fixes a bug with allowing queries to reference tables in the dbname.tablename format
  • Lowers memory usage for a regex checking for UTF-8 encoding
  • Fixes an issue with trying to change the wrong index in the wp_signups table on utf8mb4 conversion
  • Improves performance of loop detection in _get_term_children()
  • Fixes a bug where attachment URLs were incorrectly being forced to use https in some contexts

For more information click here

WordPress 4.1.1 Maintenance Release

WordPress 4.1.1 is now available. This maintenance release fixes 21 bugs in version 4.1.

The 5 Best WordPress Plugins to Promote Your Website

The overplus of free WordPress plugins area unit one among the largest reasons why WordPress is my favorite blogging platform. WordPress is additionally terribly straightforward to customise to your preferences. Blogging could be a nice selling strategy with several extra advantages and therefore the free WordPress plugins below will create it easier to push your journal.

  1.  Mailchimp

Building a mailing list is a great way to build engagement with readers. Mailchimp is my preferred email marketing product. The Mailchimp WordPress plugin enables you to embed an email sign up form on your WordPress blog. Once you start building your email list, you will have an audience to send your content or products too. A mailing list allows you to retain the audience you acquire. You can learn more about Mailchimp by watching my free video tutorial video here.

 

  1. Pretty Link

According to the the plug in’s developer, Pretty Link enables you to “Shrink, track and share any URL on the Internet from your WordPress website. Unlike other link shrinking services like tinyurl, budurl, and bit.ly, this plugin allows you to create short links coming from your own domain!” Pretty Link is great for masking affiliate links and for verbally pointing people to a certain page. For example, if you are doing a Podcast or public speaking gig, you wouldn’t want to point people to a really long complicated web address, or even tell them where to search. Make it as easy as possible for people by creating an easy to pronounce and read address.

 

  1. Google Analytics

According to it’s developer, “This plugin makes it simple to add Google Analytics to your WordPress blog, adding lots of features, eg. custom variables and automatic clickout and download tracking.” Google Analytics is one of the most essential tools for anyone who is serious about blogging. It enables you to track and analyze all the traffic you get on your site so that you can tailor your future content and promotion strategies. If you use Google Analytics and WordPress, you will need this plugin.

 

  1. Yoast WordPress SEO

This plugin makes it easier to look engine optimize every of your journal posts. It’s one in all the foremost well-liked WordPress plugins and is very simple to use. No got to have any programming skills, or perhaps any advanced SEO data, this plugin provides a straightforward to use interface for coming into knowledge that may assist you rank higher on Google. This plugin alone is one in all the most important reasons to use WordPress rather than another blogging platform.

 

  1. SumoMe

SumoMe could be a useful gizmo for marketers that incorporate a sort of valuable applications. The List Builder application permits you to show a customizable pop window to viewers of your web log. The pop window could be a good way to create your email list and it integrates with Mailchimp and different email selling product The Share application is comparable to Digg Digg, however with a gouger style and you’ll select to not show what percentage times the page has been shared. you may not need to show what percentage times it’s been shared if the quantity is low (it would cause you to look unpopular). The Share application could be a good way to induce additional shares and shares ar an excellent thanks to get additional traffic.

The good Bar is comparable to a different in style blogging tool referred to as HelloBar. It permits you to form a extremely uncontrollable graphic bar at the highest of your web site. you’ll use the bar to drive email sign ups or traffic to one thing you would like to spotlight. SumoMe incorporates a few different nice applications and that they appear to be perpetually adding new ones. SumoMe could be a terribly comprehensive plugin with plenty important.

 

New Features in WordPress 4.0

General

  • Featured image previews now support .bmp files
  • Featured Image meta box is now hidden for contributors lacking upload capabilities
  • New supported oEmbed providers: CollegeHumor, Issuu, Mixcloud, YouTube playlists, TED talks
  • Install WordPress in your language
  • Streamlined Language management right from the dashboard

Posts

  • Display embed previews for audio/visual URLs in Visual editor content box.
  • Page scrolling now scrolls post content box.
  • Edit Post/Page menu bar sticks to top of content box when scrolling (Visual and Text editor).
  • Color picker was re-added to the Visual editor

Media

  • Add Media Grid view option (default) for Media Library
  • Add “Bulk Select” button to Media Grid view to delete multiple items
  • Add oEmbed support for TED talks, Mixcloud, CollegeHumor.com, Issuu
  • Expand oEmbed support to include YouTube playlist URLs and Polldaddy’s short URL format
  • Remove Viddler oEmbed support
  • Update SlideShare oEmbed regex
  • Improved media experience on small screen sizes (embedded videos now responsive)
  • Native video and audio shortcodes now support Flash playback looping

Comments

  • Comments in trash can now be marked as spam.

Plugins

  • Display plugins list as grid, with thumbnails, on Add New screen.
  • Add popup window with plugin details (displays info from plugin’s directory page).
  • Add “Beta Testing” tab to Plugins screen for new features-as-plugins.

Accessibility

  • Improved keyboard accessibility in the Add Media panel
  • Improved screen-reader support for Customizer sections
  • Makes links in help tabs keyboard accessible
  • Improvements for screen-readers when managing widgets in the Customizer

Install Process

  • Add language select menu as first Installation screen (skipped for localized installs)

Multisite

  • mp4 file extension was added to allowed upload file types