Wednesday, 28 December 2016

How To Display Author Bio in WordPress

After login in WordPress login panel. Add Social Media Profile Box To User Profile:- Copy the below into your "functions.php" file to add input boxes for the user social media profiles. /*=====================================================================    * Add Author Links  * ====================================================================*/ function add_to_author_profile( $contactmethods ) { $contactmethods['rss_url'] = 'RSS URL';...

Contact form 7 Email body HTML Structure code

Style 1:- Enquiry from Website Name: [your-name] Email: [your-email] Contact No: [tel-no] Message: [your-message] This email sent from "#". ...

BbPress links shortcode in WordPress

Below given shortcode for Profile  => [BUDDYUSER-PROFILE text='Edit Profile'] Friends  => [BUDDYUSER-FRIENDS text='My Friends'] Activity => [BUDDYUSER-ACTIVITY text='My Activity'] Add following code in your theme "functions.php" file. /** bbpress profile link shortdode "[BUDDYUSER-PROFILE text='Edit Profile']" **/ add_shortcode( 'BUDDYUSER-PROFILE', 'cuser_profile_shortocode_handler' ); function cuser_profile_shortocode_handler( $atts ){ $atts = shortcode_atts( array(...

Any defined user role redirect to homepage after login in Wordpress

Paste this function into your themes "functions.php" to redirect every specific user role from the admin back to your homepage: add_action('admin_init', function() {         $wp_user = wp_get_current_user();         if(isset($wp_user->caps['subscriber']) && $wp_user->caps['subscriber']){         wp_redirect(get_site_url());         exit;  ...

Create custom user roles in WordPress

Methode 1:- Add following code in "functions.php" file // Add a custom user role $result = add_role( 'client', __('Client' ), array( 'read' => true, // true allows this capability 'edit_posts' => true, // Allows user to edit their own posts 'edit_pages' => true, // Allows user to edit...

Create an admin user by using database in WordPress

1. To begin, log into your cPanel interface. 2. From the main cPanel screen, find the Databases category and click on the icon entitled phpMyAdmin. 3. Once the first screen appears, look to the left hand sidebar and click on the database for your specific WordPress installation. If...

IF template name is this then do this in WordPress

Just add following code where you need. if ( is_page_template('template_file_name.php') ) {     // Returns true when 'template_file_name.php' is being used. } else {     // Returns false when 'template_file_name.php' is not being used. } ?> ...

Notice Undefined offset error Solution in WordPress

Method 1:- Please deactivate the wp debug mode. Open up wp-config.php and replace: define( 'WP_DEBUG', true ); with define( 'WP_DEBUG', false ); Method 2:- Put following code in "functions.php" file. error_reporting(0); @ini_set(‘display_errors’, 0); ...

Saturday, 5 November 2016

If Page specific id then code execute WordPress code?

IT NEW CODE gives a way to execute some code on only fix page. We can do it by using page id. Below is given code.In this code if page id match then only code will be execute. Here, 156 id is page id Code is below: <?php...

How to Hide WordPress Theme identity?

IT NEW CODE gives to rename a theme as your project or website name.There are some steps to follow you. 1> Add following code in "function.php" file. ---------------------------------------- // // To hide WP header identity // remove_action('wp_head', 'wp_generator'); // //To Change Name Howdy in wp Admin top right...

How to add multiple header and footer in WordPress?

IT NEW CODE give a trick to make multiple header & footer  templates. Sometimes We need multiple kind of look & client needs different header.In such a case need to create multiple header files. Below describes how to create multiple headwer & footer. Create New Header:- In Your...

How to Disable auto formating?

IT NEW CODE give trick to disable auto formatting paragraph tag <p>. To solve just like auto <p> tag generation problem add following code in your theme "function.php" file. <?php remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); ?> For more Interesting, Useful Article & codes visit IT...

Thursday, 3 November 2016

How to Disable Ctrl+U?

Sometimes to protect our website content from copy-paste & miss use of it or protect it from spam uses need some security. To check the code of webpage "Ctrl+U" is use.Below is given method to stop this code by script.Simply Add this code. Here Script is stop "Ctrl+U" by...

Monday, 31 October 2016

How to hide Coupon form in WooCommerce, WordPress?

In case you're not utilizing coupons by any stretch of the imagination, you can conceal the structure on the truck and checkout page by unchecking "coupons checkbox" from WooCommerce > Settings > General, yet most times you'll need to leave coupons empowered on the off chance that you...

Woocommerce add to cart button redirect to checkout Learn

Method 1 for manual link:- Try WooCommerce default method for add to cart button redirect to checkout. You can find the option in the WooCommerce -> Settings -> Products -> Display area. When the option “Redirect to the cart page after successful addition” is checked it will redirect...

Sunday, 9 October 2016

How to change WordPress login page WordPress Logo?

You can change WordPress login page WordPress logo to website logo using Two methods. Method 1:- Using Plugin:- Customize Login Image: https://wordpress.org/plugins/customize-login-image/screenshots/ WP Custom Admin Login Page Logo: https://wordpress.org/plugins/wp-custom-login-page-logo/screenshots/ Method 2:- Using code:- First you need to open your theme’s "functions.php" file and then paste the following code:...

Saturday, 8 October 2016

How to any value display only till 2 decimal points?

Using following methods can display only 2 decimal point value. Method 1:- <?php $final_total=199.9; $formattedNum = number_format($final_total, 2); echo $formattedNum; ?> Method 2:- <?php $final_total=199.9; echo $number = sprintf('%0.2f', $final_total); ?> For more Interesting, Useful Article & codes visit IT New Code. ...

How to hide other Shipping methods When free Shipping is available in WooCommerce, WordPress?

Some times there are many methods use for diffident need & conditions in WooCommerce. In it one comman condition is like "Hide other Shipping methods When free Shipping is available". Below is given solution of this condition. First create Free Shipping method with condition.Then, Add following code in...

How to Create Contact form 7 HTML Structure code for send E-mail in WordPress?

First Create Contact form in contact form 7 Plugin. Then Put following code in Mail structure. CODE:- <div style="width:70%;background: rgba(204, 204, 204, 0.36);padding: 30px;margin: 0 auto;"> <center><img style="max-height: 100px;" src="Logo_url"></center> <center><h2>Inquiry About Site</h2></center> <center> <table style="background: #DDDDDD;color: #005BC6;width: 90%;"> <tbody> <tr style="line-height: 24px;"> <td style="padding: 5px 10px;color: #000;font-weight:...

In WordPress if template name is "something" then excecute code?

Just add following code where you need. <?php if ( is_page_template('template_file_name.php') ) {     // Returns true when 'template_file_name.php' is being used. } else {     // Returns false when 'template_file_name.php' is not being used. } ?> For more Interesting, Useful Article & codes visit IT New...

Wednesday, 27 July 2016

How to Rename Coupon Code fields with WooCommerce, WordPress?

Just renaming the coupon field to something else can likewise diminish the quantity of clients that leave your site amid checkout to discover coupon codes. Clients that as of now have the code will comprehend what name to search for whatever length of time that you're steady. For...

Saturday, 23 July 2016

Learn about left join query

The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match. In some databases LEFT JOIN is called LEFT OUTER JOIN. Query:- SELECT column_name(s)FROM table1LEFT JOIN table2ON table1.column_name=table2.column_name; OR...

Saturday, 25 June 2016

How to Create Custom Plugin?

Hi, Learn here to create Simple form  Plugin. Create 3 files & 1 directory as "images" name. 1. custom_fields_variable.php 2. readme.txt 3. uninstall.php 1> Here, "images" Directory for Upoad Images like, logo. 2> "readme.txt" for description about your Plugin. 3>  Copy following code in "custom_fields_variable.php"  file.       All details are...

Friday, 24 June 2016

Learn Various Anchor tag Usage.

The <a> Anchor tag use for the hyperlink, Always <a> Anchor tag is use for link one page to another page or Same page jump to selected div or section. The most important attribute of <a> tag is the "href", which is used for destination link. Another attribute...

How to Fetch Data from Database of all users in table structre, Open Each user profile & Update it? How to Get Value By passing Variable as id?

Create three files & 1 directory create called "upload". 1. alluserfetchdata.php 2. Adminupdateotherprofile.php 3. Adminupdateotherprofileprocess.php 1> Copy Following code in "alluserfetchdata.php" file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Fetch data</title> </head> <body> <table width="200" border="1">  <tr> <th>No</th> <th>name</th>...

How to Fetch Data from Database as Single person Profile & update Profile data?

Create two files &  1 directory create called "upload". 1. profile.php 2. profileupdateprocess.php 1> Copy Following code in "profile.php" file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Profile (Fetch data)</title> </head> <body> <?php session_start(); $id=$_SESSION['id']; //echo $_SESSION['id']; $con=mysql_connect('localhost','root',''); if(!$con)...

 

Copyright @ 2016 IT New Code | Developing Code | Designing Code.

Designed by: Templateism