By default WordPress pagination slug is – /page/[page_number]. How about if we need to change this to something else? Perhaps your site is not in English, and you want pagination in your language? This is very easily controllable with pagination_base property of WP_Rewrite class. Code goes in the functions.php file… Read More »
Load Contact Form 7 (CF7) JavaScript and stylesheet only when it is necessary
By default, the popular Contact Form 7 (CF7) plugin loads it’s javascript and css stylesheet files on every page. This is unnecessary extra load on your website front-end. Those javascript and css files are only needed on the page where there is a CF7 form. But not to worry, as… Read More »
Modify default WordPress search URL
By default WordPress search result page URL is a query parameter – ?s=[search_term]. Not a very “pretty” URL! But we can make it a nice “pretty” url with a little code snippet. Above code will make your search page url from https://careless.dev/?s=[search_term] to https://careless.dev/search/[search_term]. But /search/ is the default slug… Read More »
Show customer details on WooCommerce thank you page
If you are accepting guest orders on your WooCommerce store, after placing an order, guest users/not logged in users don’t see their details (customer details – billing/shipping addresses) on the thank you page. This can be confusing for some users, as they might be feeling comfortable seeing their billing/shipping address… Read More »
Remove “optional” text from WooCommerce checkout fields
Optional input fields in WooCommerce checkout is marked with (optional) text. This text can be removed without editing any WooCommerce template, by using woocommerce_form_field filter. Code goes in the functions.php file of your active theme…. Read More »
Customize WooCommerce order notes placeholder and label
By default the label of “order notes” on WooCommerce checkout page is “Order notes”, and placeholder is “Notes about your order, e.g. special notes for delivery.”. This can be updated using woocommerce_checkout_fields filter. Modify the placeholder and label as per your need, from the below code. Code goes in the… Read More »
Advanced Custom Fields (ACF) field values are not visible on draft preview
ACF post meta fields’ (custom fields) values are not visible on draft preview – before you publish a post. If you want to preview a post/page, before you want to publish, this is going to cause headache. If you already did not know about this issue, you would be lost… Read More »
Hide Advanced Custom Fields (ACF) from WordPress Admin
If you are developing a site for your client, where you are using ACF to add and show custom post meta content or any other content that ACF allows, it is sometimes (from my experience – almost all the time) better to hide the ACF from your clients or the… Read More »
How to disable option to deactivate plugin in WordPress
Did you ever feel the need to disable plugin deactivation option? I generally use ACF to add and show custom content for clients. Now if the client deactivate ACF plugin, this could break their site. Instead of taking this risk, we can easily disable the deactivation option for specific plugin…. Read More »
How to add Google Analytics code in WordPress without plugin
There are lots of plugin available to add Google Analytics code (or Google Tag manager code) in your WordPress. But is this really necessary to add yet another plugin, just to add a little code block (yes Google Analytics/Tag Manager code is just a little tiny code block)? We can… Read More »
