Method 1: Use Custom VC Column Layout
Method 2: Create 1/12 + 2/12 + 2/12 + 2/12 + 2/12 + 2/12 + 1/12 columns then leave the first and last empty.
Method 3: This one is a bit complicated and requires a bit understand of CSS. The idea is to create 6 columns, gives the first 5 columns the widths of about 20%, then hides the sixth column.
Step 1: Create a row and give it a class home_row
Step 2: Create 6 columns and assign a class to the last one: home_row_sixth
Step 3: Edit the width of each column
.home_row .vc_col-sm-2 {
width: 20%;
position: relative;
}
Step 4: Hide the sixth column
.home_row_sixth {
visibility: hidden;
width: 0px;
padding: 0px;
}
Step 5: Make sure it is responsive
@media only screen and (max-width: 768px){
.home_row .vc_col-sm-2{
width: 100%; }
}
Month: August 2016
Disable/enable submit button & readonly to textbox using jQuery
Using “attr()” function we will enable or disable submit button please find below code.
$(document).ready(function() {
$(‘input[type=”submit”]’).attr(‘disabled’, true);
$(‘input[type=”text”]’).on(‘keyup’,function() {
if($(this).val() != ”) {
$(‘input[type=”submit”]’).attr(‘disabled’ , false);
}else{
$(‘input[type=”submit”]’).attr(‘disabled’ , true);
}
});
});
/*Add and remove readonly to a textbox*/
if(rBtnVal == "yes"){
$("#no_of_staff").attr("readonly", false);
}
else{
$("#no_of_staff").attr("readonly", true);
}
Change label & placeholder in woo-commerce checkout billing form
Please find below code to change label & placeholder in woo-commerce checkout billing form
add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’ );
function custom_override_checkout_fields( $fields ) {
unset($fields[‘billing’][‘billing_last_name’]);
$fields[‘billing’][‘billing_first_name’][‘placeholder’] = ‘Contact Name’;
$fields[‘billing’][‘billing_first_name’][‘label’] = ‘Contact Name’;
return $fields;
}
Sorry, it seems there are no available payment methods which support subscriptions. Please contact us if you require assistance or wish to make alternate arrangements.
When getting this type of issue please check site SSL is enable or not.
Stripe is enabled, but the force SSL option is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate – Stripe will only work in test mode.
Custom pagination for wordpress admin dashboard table
/* Custom pagination for wordpress admin dashboard table start */
$per_page = 3;
if (isset($_GET[‘paged’])) { $page = $_GET[‘paged’]; } else { $page=1; };
$start_page = ($page-1) * $per_page;
$this->items = $wpdb->get_results(“SELECT * FROM $table_name LIMIT $start_page, $per_page”, ARRAY_A);
// [REQUIRED] configure pagination
$this->set_pagination_args(array(
‘total_items’ => $total_items, // total items defined above
‘per_page’ => $per_page, // per page constant defined at top of method
‘total_pages’ => ceil($total_items / $per_page) // calculate pages count
));
/* Custom pagination for wordpress admin dashboard table end */
Restrict number of characters in textarea using jQuery
Check if a page has a vertical scrollbar or Horizontal Scrollbar using jQuery?
Please find below code to find scrollbar
jQuery(document).ready(function() {
// Check if body height is higher than window height :)
if (jQuery("body").height() > jQuery(window).height()) {
alert("Vertical Scrollbar!");
}
// Check if body width is higher than window width :)
if (jQuery("body").width() > jQuery(window).width()) {
alert("Horizontal Scrollbar!");
}
});
How to stop wordpress from changing default .htaccess permissions to 444
Please find below points
1. It’s quite possibly your hosting provider isolating it from the other users on the server. I’d recommend checking with them, though it’s unlikely that they’d want to change that.
2. Your site has likely been hacked. In my website injected some malicious code into wp-includes/nav-menu.php, causing .htaccess to reset to 444 on any page load.
To remove hacking code please find below steps
1. Take your site offline as soon as possible & change the permissions of the site folder to 600
2. Re-name the website’s folder (public_html or your domain name) to something else and create a different folder with the same name as the original. Put a file called .maintenence in this folder. this will put your website in maintenance mode. You can use any html you want in the .maintenance file.
3. Download WordPress. Make sure you download an appropriate version. You can find the version of this wordpress install by viewing the version number in /readme.html (not recommended to keep this file).
4. Delete the following directories: wp-includes and wp-admin and replace these with the directories from a freshly downloaded WordPress. This will clean up the core files. It is important to delete these folders instead of merging them as a merge will not get rid of the files that are not part of wordpress core.
5. In the root directory, delete all files but from wp-config.php.
6. Replace these with the files from the freshly downloaded wordpress instance.
7. Rename your original directory back to it’s original name.
Check this url for some solution
Custom logo with custom URL in WordPress login page
/* Custom Logo */ function custom_login_logo() { echo ' h1 a { background-image: url('.get_bloginfo('url').'/wp-content/uploads/2020/02/logo.png) !important; } .login h1 a{ background-size: 320px !important; width: 320px !important; } '; } add_action('login_head', 'custom_login_logo'); /* Custom URL for logo */ add_filter( 'login_headerurl', 'custom_loginlogo_url' ); function custom_loginlogo_url($url) { return get_bloginfo('url'); }
How to create WordPress child theme
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
A child theme consists of at least one directory (the child theme directory) and two files (style.css and functions.php).
Put below code in child theme style.css
/*
Theme Name: Aviweb Child Theme
Theme URI:
Description: This is a child theme for Aviweb
Version: 1.0
Author:
Template: aviweb
*/
@import url(“../aviweb/style.css”);
Create functions.php file within child theme folder and write our own custom code.