Codex Topic: WordPress
-
GDPR Embed Consent Box
This can be used for map or video with little wording changes. aaand it can be used with Elementor HTML widget just paste this and change the Map Widget ID as “#embed-consent” that’s it. <div class=”consentbox”> <div class=”consent-section”> By loading the map, you agree to Google’s privacy policy. </div> <div class=”openthemap”>Show Map</div> <div class=”consent-section”> <input…
-
Disabling WordPress Core, Theme and Plugin Updates From Functions.php
sometimes stupid core updates breaks the plugins or the otherway around stupid plugin updates breaks the core. Doesnt matter. add this code to the functions.php and stop those updates. Only minor WordPress bugfix or secuırity updates will continue. add_filter( ‘allow_major_auto_core_updates’, ‘__return_false’ ); add_filter( ‘auto_update_plugin’, ‘__return_false’ ); add_filter( ‘auto_update_theme’, ‘__return_false’ ); if you want…
-
Change Increase WordPress Revision History Setting
Default revision history setting is lame not even useful.. Add this code to the fucntions.php this makes the revision history 600 I use it all the time. it makes the db grow faster but saves time when you need to reroll something back… // WP Revision History Count , Set to 600 // Add…
-
Making Caption Textfield bigger WordPress Media Library Editing
add_action(‘admin_head’, ‘g_custom_css’); function g_custom_css() { echo ‘<style> #attachment-details-caption , #attachment-details-two-column-caption { height:220px; } </style>’; }
-
Wrapping All WordPress Site inside in a Custom Div
// Smooth content scroller wrapper for all site function div_wrapper_open() { echo ‘ <div id=”smooth-wrapper”><div id=”smooth-content”> ‘; } add_action( ‘wp_body_open’, ‘div_wrapper_open’ ); function div_wrapper_close() { echo ‘ </div></div> ‘; } add_action( ‘wp_footer’, ‘div_wrapper_close’ ); add this to your fucntions.php to wrap all your site in 2 div. i use this usually for smooth scroll for…
-
Disable WordPress LazyLoad Images
add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ ); add this to the functions.php and it will disable the WordPress default lazy load settings.
-
Custom Image Sizes for WordPress Custom Designs
add_image_size( ‘size-300×600’, 300, 600, true ); add_image_size( ‘size-590×880’, 590, 880, true ); add_image_size( ‘size-530×795’, 530, 895, true ); add_image_size( ‘size-400×540’, 400, 540, true ); add_image_size( ‘size-1000×730’, 1000, 730, true ); add_image_size( ‘size-1220×730’, 1220, 730, true ); add_image_size( ‘size-1300×900’, 1300, 900, true ); put this on functions.php change it remove or add more …
-
Changing Add to Cart button Text with something else
Changing Add to Cart button Text with something else // Change add to cart text on single product page add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘woocommerce_add_to_cart_button_text_single’ ); function woocommerce_add_to_cart_button_text_single() { return __( ‘Add to Cart Button Text’, ‘woocommerce’ ); } // Change add to cart text on product archives page add_filter( ‘woocommerce_product_add_to_cart_text’, ‘woocommerce_add_to_cart_button_text_archives’ ); function woocommerce_add_to_cart_button_text_archives() {…
-
Adding Minimum Order Amount Count on Cart
Adding Minimum Order Amount Count on Cart It is possible to make this with some plugins and addons but this method much simpler and faster. Less plugin is the better. add_action( ‘woocommerce_checkout_process’, ‘wc_minimum_order_amount’ ); function wc_minimum_order_amount() { global $woocommerce; $minimum = 50; if ( $woocommerce->cart->get_cart_total(); < $minimum ) { $woocommerce->add_error( sprintf( ‘You must…
-
Single Product Tab Name Change or Renaming or Replacing
Single Product Tab Name Change or Renaming or Replacing add_filter( ‘woocommerce_product_tabs’, ‘woo_rename_tab’, 98); function woo_rename_tab($tabs) { $tabs[‘description’][‘title’] = ‘More info’; return $tabs; }