Adding a Site Login/Logout Link to an existing Menu in WordPress
You can add on to the end of an existing WordPress menu a site login/logout link. The WordPress menu must be registered and have a theme location, this will not work with custom menus. This needs to be added to your theme functions.php file add_filter( ‘wp_nav_menu_items’, ‘themeprefix_login_logout_link’, 10, 2 ); function themeprefix_login_logout_link( $items, $args ) { if(…
Read MoreCombining VOB files into one in Linux or macos and convert to MP4
So you need to combine multiple VOB files from a DVD VIDEO_TS folder into one and convert to MP4? One of the easiest and quickest ways to do this is a simple method on the command line to merge the files and then use a free video converter to change format. Merging the VOBs Launch…
Read MoreAdd a Manual Warm Up Cache / Cache Crawler to LiteSpeed Cache
In caching plugins normally pages are typically served from a cache after a visitor does an initial view then a cached copy of the page is served up to subsequent visitors via the cache who have faster viewing page loads. This works well in high traffic sites but if the site is more a brochure…
Read MoreRemoving Scheduled Actions from WooCommerce Action Scheduler
The Scheduled Actions that sit in WooCommerce Action Scheduler can get stuck with thousands of actions piling up, just stuck in a failed, canceled, pending or complete state. This can result in bloated database tables in particular wp_actionscheduler_actions and wp_actionscheduler_logs tables. Since the states of failed, canceled or complete are already passed, you would be…
Read MoreImage Carousel Thumbnail Slider with ACF Gallery Field in WordPress
Here is a guide on how to make an image carousel thumbnail slider with ACF in WordPress using the ACF gallery field. Lightslider, a lightweight image slider seems to fit the bill perfectly – I need it to just display simple thumbnails below the main image which on click/touch show the image in the main slide…
Read MoreAdd WooCommerce Cart Icon to Menu with Cart Item Count
Here is a way to add WooCommerce cart icon to a menu with the cart item count, it links to the cart page and displays the number of items that have been added to the cart. The code uses three functions which need to be added to functions.php and some CSS in style.css. (If you just…
Read MoreRedirect all pages to a ‘Coming Soon’ Page in WordPress
You can redirect all your WordPress pages to a designated Coming Soon page for all non-logged in users with the template_redirect action hook whilst leaving all pages visible to logged in users. add_action( ‘template_redirect’, ‘themeprefix_coming_soon’ ); function themeprefix_coming_soon() { if( !is_user_logged_in() && ! is_front_page() || is_home() ){ wp_redirect( site_url() ); exit(); } } So in…
Read MoreAdding Expires Header to htaccess
Expires Headers are a set of rules or directives from a website to tell a user’s local browser to either look in its own cache for files or to request the files off the webserver, the former is better for speed of the web page load and a reduction in the webserver processing. For Apache…
Read MoreBlock xmlrpc.php requests from Cloudflares firewall apart from JetPack
You can block WordPress xmlrpc.php requests from Cloudflare but exclude the JetPack IP addresses by creating a custom firewall rule, attacks on xmlrpc.php are frequent and it is best now disabled as it will be deprecated from WordPress in the future. However, some of the more popular WordPress plugins such as JetPack still need to…
Read MoreChange WooCommerce Sold Out text
You can change WooCommerce ‘Sold Out’ text set by the inventory setting of Sold Out with the WooCommerce filter woocommerce_get_availability_text Add the below snippet with your custom sold text to functions.php add_filter(‘woocommerce_get_availability_text’, ‘themeprefix_change_soldout’, 10, 2 ); /** * Change Sold Out Text to Something Else */ function themeprefix_change_soldout ( $text, $product) { if ( !$product->is_in_stock()…
Read More