Skip to content

Instantly share code, notes, and snippets.

@mohsinworld
mohsinworld / Disable Automatic Updates
Last active November 9, 2022 10:40
Need to add this code into functions.php file inside the themes folder
// Disable core auto-updates
add_filter( 'auto_update_core', '__return_false' );
// Disable auto-updates for plugins.
add_filter( 'auto_update_plugin', '__return_false' );
// Disable auto-updates for themes.
add_filter( 'auto_update_theme', '__return_false' );
.fluentform .ff-el-form-control {line-height: 3;}
.fluentform .ff_btn_style {line-height: 3;}
// Form Part
<div class="custom-form">
<div class="name">
[text* your-name placeholder "Your Full Name"]
</div>
<div class="email">
[email* your-email placeholder "Your Email Address"]
</div>
<div class="button-sumbit">
@media only screen and (min-width:783px) {
.forminator-row {
float:left;
padding-right:20px;
}
}
.forminator-input {
border-radius: 5px;
}
@mohsinworld
mohsinworld / Selection Color For Website
Created July 9, 2021 15:15
Add this code into "Additional CSS" for your WordPress website
::selection {
background-color:#333;
color:#fff;
}
Add to cart but stay on the page: /?add-to-cart=[product ID]
Add to cart and go to cart page: /cart/?add-to-cart=[product ID]
@mohsinworld
mohsinworld / Google News RSS Feed URL structure
Created March 20, 2021 17:30
after this ?q= the keyword should be there
https://news.google.com/rss/search?q=70smusic
@mohsinworld
mohsinworld / Embed YouTube Playlist Into Website
Last active October 2, 2022 16:25
"PLJfJ0pgBPYK9o9Bdk7-yajxvCduglPfGa" this playlist ID will be replaced by the actual playlist ID
<iframe width="100%" height="412" src="https://www.youtube.com/embed/videoseries?list=PLJfJ0pgBPYK9o9Bdk7-yajxvCduglPfGa&?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
@mohsinworld
mohsinworld / Redirect Users to Custom Page After Order Completation on WooCommerce
Last active March 8, 2021 00:00
Need to place this code into functions.php file
// Redirect WooCommerce checkout page to a custom thank you page
add_action( 'woocommerce_thankyou', 'pfwp_redirect_woo_checkout');
function pfwp_redirect_woo_checkout( $order_id ){
$order = wc_get_order( $order_id );
$url = 'CUSTOM THANK YOU PAGE URL';
if ( ! $order->has_status( 'failed' ) ) {
wp_safe_redirect( $url );
exit;
}
@mohsinworld
mohsinworld / Rename Add to Cart Button on WooCommerce
Last active March 8, 2021 00:01
Need to place this code into functions.php file
//single product and general archives filters
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_woocommerce_button_text' );
add_filter( 'woocommerce_product_add_to_cart_text', 'custom_woocommerce_button_text' );
//callback function
function custom_woocommerce_button_text(){
return __( 'Buy Now', 'mohsinalam' );