Skip to content

Instantly share code, notes, and snippets.

View cpaul007's full-sized avatar
🏠
Working from home

Chinmoy Paul cpaul007

🏠
Working from home
View GitHub Profile
@cpaul007
cpaul007 / checkout-button-text.php
Created October 30, 2020 14:36
Change the Checkout Button Text
<?php
add_filter( 'gettext_woocommerce', 'ouwoo_checkout_button_text', 10, 3);
function ouwoo_checkout_button_text( $translated_text, $text, $domain ) {
switch( $translated_text ) {
case 'Checkout' :
$translated_text = "ENTER YOUR TEXT HERE";
break;
}
return $translated_text;
@cpaul007
cpaul007 / product-category-description-with-link.php
Created October 7, 2020 18:27
Product Category Description with Link
@cpaul007
cpaul007 / ff-input-number-format.js
Created May 17, 2020 03:48
Numver Fortmat in JavaScript
jQuery(document).ready(function($){
//* #ff_10_value_1,#ff_10_value_2 are input field ID.
$('#ff_10_value_1,#ff_10_value_2').on('keyup blur', function(){
var value = $('#ff_10_sum_ff').val();
//* #ff_10_sum_ff is the calcualtion field ID where value is showing
$('#ff_10_sum_ff').val( numberFormat(value, 2, '.', ',') );
});
});
function numberFormat (number, decimal_pos, decimal_sep, thousand_sep) {
@cpaul007
cpaul007 / ff-toggle-next-button-step-form.js
Created May 9, 2020 10:00
Toggle next button of 1st step form
$('input[name=have_business]').on('change', function(){
checkedVal = $('input[name=have_business]:checked').val();
if( checkedVal == 'no' || checkedVal == 'No' ) {
$('.first-step').find('div.step-nav').hide();
} else {
$('.first-step').find('div.step-nav').show();
}
});
@cpaul007
cpaul007 / ff-last-step-form-buttons-alignment.css
Last active December 20, 2023 14:45
Removing the previous button and center align the submit button at last step form
/* .fluent_form_18 is my form class. youe will replace form ID 18 with your form ID */
.fluent_form_18 .fluentform-step:last-child .ff_step_nav_last {
display: none;
}
.fluent_form_18 .fluentform-step:last-child .ff-t-column-2 {
display: table-row;
}
@cpaul007
cpaul007 / ff-order-form.css
Created May 9, 2020 09:08
CSS Snippet for Order Form
.fluent_form_18 .ff-el-form-check-label {
display: none;
}
.fluent_form_18 .ff-el-image-holder {
border: 2px solid #f8f8f8;
padding: 5px 5px 0;
}
.fluent_form_18 .ff-el-image-holder.ff_item_selected {
@cpaul007
cpaul007 / ff-gdpr-checkbox-align.css
Created May 7, 2020 09:36
Fix alignment of GDPR checkbox
.ff_t_c,
.ff_gdpr_field {
vertical-align: top!important;
}
@cpaul007
cpaul007 / ff-reset-button.php
Created May 5, 2020 06:37
Add the reset button into the Fluent Forms
<?php //* do not inlcude this line
add_filter( 'fluenform_rendering_field_html_button', 'paulc_add_reset_button', 99, 3 );
function paulc_add_reset_button( $html, $data, $form ) {
//* You will replace the form ID 2 with your form ID
if( $form->id == 2 ) {
$reset_btn = '<button class="reset-button ff-btn ff-btn-md" type="reset">Reset</button>' . "\n";
$html = str_replace( '</div>', $reset_btn . '</div>', $html );
}
@cpaul007
cpaul007 / category_post_image.php
Last active February 15, 2017 06:09
Replacing the featured image with any other internal image of a post (only for category page)
<?php //* Remove this line
add_filter( 'genesis_get_image', 'gd_category_post_image', 10, 6 );
/**
* Replacing the featured image with any other internal image of post
* if there have more than one image and not set as featured image
*
* @author Chinmoy Paul
* @copyright Copyright (c) 2017, Genesis Developer
* @license GPL 3.0+
@cpaul007
cpaul007 / functions.php
Created September 15, 2016 12:59
Creating full width home page on Elegance Theme
<?php
//* Do not add PHP opening tag. Copy the code below this line
add_action( 'genesis_header', 'elegance_header_wrapper_open', 4 );
function elegance_header_wrapper_open() {
if( !is_front_page() )
return;
echo '<div class="site-header-container"><div class="wrap">' . "\n";
}