How to check if a checkbox has been ticked in Jquery

jquery icon

  Its very easy to add a checkbox in HTML but once it has a tick in the box how can we trigger an action to happen. This would usually be on a click event of a button, not when the button is ticked, probably use on focus of that box or click event of […]

Firefox 89-100 (2022) Tabs on top/bottom not working fixed again

Firefox - Codehaven

Works with Firefox version 100 – May 2022 onwards Make the Browser Tabs appear at the Top You use the tabs far much more than the URL bar, so it makes sense, and saves many miles on your mouse. Put the tabs nearer, the action, and the URL bar further away, as it’s not as […]

Slash canonicalization at the end of the URL – htaccess

wordpress category

If you have a website, you should always use the forward slash at the end of all urls. If for some reason you do not, then this code is very helpful. To remove a slash at the end: example: – https://www.codehaven.co.uk

To add a slash to the end example: – https://www.codehaven.co.uk/

Airqino Type 1 Sensor Installation

airquino planetwatch

Planetwatch air quality sensor here at last. After many months of waiting it finally arrived. Installing the actual device was not a problem, but the faff of emailing the form, then activating it, setting up a wallet and finally turning it on takes time. Thanks to the YouTube video, it sets out what you need […]

Elementor json template files not uploading

elementor

Are you having trouble uploading Elementor json template files? Do they produce an error as shown below? After trial and error I have fund that since about 25th Dec 2021 Elementor added some code that prevents uploads of JSON files as it use to. The code now tries to strip any bad content from the […]

Multiple featured images for blog posts

elementor

WordPress gives you only space for one featured image. If I wanted to added more featured images there is such a plugin for that. Configuring it is another job, that people read the specs but cant understand it. This is the problem with the way many plugins make it difficult to understand how to add […]

A Free Website on the Blockchain!

unstoppable

A website on the blockchain! I set out to research something I had stumbled upon and thought I would show my research journey and my thoughts along the way. I had found Unstoppable Domains! https://unstoppabledomains.com/ The following is my understanding along the way, some of which may be wrong but hopefully I will answer how […]

Passive Earning – Hi Dollars Crypto App

hilogo

earn Passive income with the hi Dollars App Start earning now Invite only ‘hi Dollars’ – Start earning passive income £25 P/M for clicking a button This simple app is a great starter for those who want to start into the cryptocurrency world without actually having to use any money. You can earn money by […]

Autostart Browser in Kiosk Mode – Raspberry Pi 4 Terminal Command

Raspberrypi - Codehaven

The following code will boot your Raspberry Pi 4 stright into a full screen kiosk mode that displays a specific web page. The screen size is for the official Raspberry Pi screen 7 inch. This uses Raspbian and chrome, which should come pre installed.

Then just paste this code

Save all the files. […]

Open Chromium full screen -Raspberry Pi (Kiosk mode)

Raspberrypi - Codehaven

Simple way to run the chromium browser full screen on boot. In command line :- This file: –

add this: –

In the following file : –

add this:-

This is a quick and dirty way, but a more in depth tutorial you can see below. Open an HTML page when […]

Populate dropdown with data from database

php codehaven

Populating a Select dropdown with data stored in the database can be tricky if not done correctly. This is the best way to recall that data simply.

Best Stablecoin Investing Websites

stablecoins,on,stage;,usdc,,dai,and,usdt,(tether),3d,illustration

If you have just started to looking into crypto currencies, maybe the earning of HNT has sparked your enthusiasm. The websites shown are what I use everyday to deal with my own crypto. They come highly recommended. STABLECOIN INVESTING A stablecoin stays at a steady level inline with USD so as this does not fluctuate […]

Exclude a specific page from WordPress sitemap – wp-sitemap.xml

wordpress category

Since WordPress now creates sitemaps automatically since version 5.5, excluding a particular page is not widely known. The code below will exclude a page from the wp-sitemap.xml

Firefox screenshot button missing – Version 88

Firefox - Codehaven

Have you noticed the ‘screenshot’ feature seems to have disappeared from Firefox? The latest update has changed it from being a “Page Action” which is usually found in the address bar, to a “Browser Action” that now shows as an optional button for the main part of the toolbar. You can add the button by […]

Best FAQ Schema for Rich Results

codehaven code snippet review

What FAQ Rich Results plugin should I use? We all want to see the following image appear when we test our FAQ’s page, but how do we get this to work? What WordPress plugin should I use? Both of the following plugins work very well, both personally tested. Both plugins show the interface in the […]

WordPress sitemap not working after uninstalling Yoast

wordpress category

Looks like Yoast has gone out of its way to cripple WordPress sitemaps after you install Yoast!!! After version 5.5 WordPress will create a sitemap for you at this address /wp-sitemap.xml Seems Yoast does not like this and disabled the core sitemap. (another reason not to use Yoast!) don’t worry we have you covered. 1. […]

Send – Serialize form and send extra variables

jquery icon

If you have many form fields, don’t collect them all individually, do it in one go using the Serialize function. Remember to add the forms id

Basic Version

To collect posted fields in PHP use this script.

Show time on Raspberry Pi from command line

Raspberrypi - Codehaven

Simple to find the time on the Raspberry pi using this one command.

I found this command the hardest to find on the internet, such a simple command to find the date and time.

wp-sitemap.xml not showing after disabling Yoast

wordpress category

After you have disabled Yoast and want to use the standard wp-sitemap.xml you may have problems. It will not work and display straight away. The error you receive maybe a 404, when loading /wp-sitemap.xml can be caused by a number of issues, including the permalinks or rewrite rules. I would recommend to try resetting the […]

WordPress app shows XML-RPC error

random coding category codehaven

If the WordPress app doesn’t work with your website, then I have the answer! 1. Download the plugin named Rename XMLRPC but DO NOT ACTIVATE THE PLUGIN YET. 2. In the root directory of the wordpress installation Find the file xmlrpc.php Rename it to xmlrpc2.php 3. Now go back into the Plugins area and activate […]

Recommended WordPress Security Headers in .htaccess

wordpress category

Check your security headers here https://sitecheck.sucuri.net/ At the bottom left hand corner after the scan, it will provide information to help you know what security headers you need. Add this to the .htaccess file in the root of your directory, it will help with the following: – HSTS – When this header is set on […]

Get the ID of the last inserted record

mysql codehaven category

When you insert a record, you may need to track the id of that inserted record and use it in another table straight after.

Redirect your old website to other domain using .htaccess file

random coding category codehaven

This type of redirection is called a 301 Permanent Redirect This is the most common type of redirect and is useful in most situations using the file in the root of the file directory. In this example, we are redirecting to the “codehaven.co.uk” domain. Use a 301 redirect .htaccess to point an entire site to […]

Import csv to phpmyadmin

mysql codehaven category

Updated 29/01/2021 Simple but can cause lots of problems. I have one column with 200,000 postcode entries! in a CSV file. One Tab. Like below My first insert of 4000 was quick without error, but the 200,000 had import errors. I tried many Free CSV splitters online but all had problems except one! https://textfilesplitter.com/ So […]

Create a plugin with shortcode for Elementor – Most basic ever!

wordpress category

1. Save this code below as rawcode.php

2. Create a folder in the plugins folder called the same – “rawcode” (\wp-content\plugins\rawcode) 3. This will now show up as a plugin. Activate it. 4. In a page or post within elementor (or without) add the following shortcode. [rawcode-plugin-demo] 5. It will now appear in the […]

Add a dropdown to Woocommerce Checkout Fields

woocommerce category codehaven

To add a dropdown or select element to the fields on a woocommerce checkout, this can be achieved by the following code. Just add this code and amend where necessary to the functions.php file. Add dropdown

Update dropdown

Display dropdown answer

Change height of category quick edit box in Dashboard

woocommerce category codehaven

To change the height of the quick edit category box add this code toy your functions.php page. It will add the CSS as the last command and you then can change the height instead of scrolling all day.

Align ‘Add to Cart’ product buttons – WooCommerce

woocommerce category codehaven

This problem should be sorted by Woocommerce but they still have the problem. when you have to redesign a website that has weird image sizes and you cant really do much about that, you need to find a way to align all the buttons so they look neat. The only way I have found that […]

Award for the Worst Unsubscribe page 2021

codehaven code snippet review

Update 15/1/21: We have had to take back the award as they have updated there unsubscribe page! (I am pretty sure they will be OK about that!). This shows they respond to emails in a positive manner and the chain of command in a complaint gets to the correct people. Well done Rated People.There updated […]

How to find the last folder in url

php codehaven

If this is my url I am running the script in http://aq.gthex.co.uk:10000/webcontent/mylogin.php and I want to find the part called webcontent use the script below to find this part.

The result will be: webcontent

Convert number to month name in PHP

php codehaven

How to catch errors and warnings in PHP

php codehaven

Catching errors and Warnings Below is a standard for catching errors. This would not work for warnings. That code is at the bottom.

How to catch warnings

Add a Favicon to your website

wordpress category

Add this code below to the header of your website. Then add the favicon (png) to the root of your website.

You can use .ico files by using the code below.

Add this to your header.php file and add the image usually 16px x 16px in your root.

Enable GTmetrix Old Style Reports – December 2020

SEO category

So GTmetrix.com thinks they have helped us, by creating a whole new version of their very good website testing site. Unfortunately they have not. They have just made it more difficult to find the results we are used to! Luckily I have found a switch within their settings that puts it all back the way […]

Free Share Code for Freetrade App

codehaven code snippet review

Buy & Sell Shares for FREE instantly Usually when you buy shares through a bank or building society like Halifax they charge you about £10 every time you buy some shares or sell them!!! Freetrade is free to buy and sell shares! USE THE LINKS BELOW https://magic.freetrade.io/join/mike/e307a29f HOW TO USE Use my link to join […]

How to remove “description” heading in product description? – WooCommerce

woocommerce category codehaven

Woocommerce provides a couple of tabs such as Product Information, and Description. you may find under the tab it repeats which can look weird. to remove the duplicate wording use the code below in the functions file.php

Adding Canonical link manually – PHP

SEO category

if you have a hand coded site to help with your SEO you need a canonical link. Below is a PHP script that creates a canonical url link on page load. So this should answer your question of how to add canonical tag in PHP This is a self-referencing canonical link

Check if PHP array empty

php codehaven

You can also use not empty, by adding an exclamation mark.