When you create content for a podcast for iTunes, Amazon Music and Spotify, the xml feed requires the length of the MP3 – that can be a problem if you are using an external mp3 file. It’s not easy to use the PHP get_id3 libraries to determine the length. If you can get them to […]
Continue reading...
Just once in a while, you can’t get into the WordPress dashboard and you need to create a new admin user quickly. You can do it with PHPMyAdmin. Login to PHPMyadmin Goto your WordPress Database table and click on SQL. Then copy and paste the MySQL statements below. Change YOUR USERNAME, PASSWORD, Your Username and […]
Continue reading...
A client wanted a glossary of terms on a WordPress site and was looking for automated links of glossary entries. Trouble is each “needle” could be a word/phrase on its own (or in brackets and with punctuatin), or a word/phrase in an anchor tag or img tag. Nightmare! str_replace and the case-insensitive str-ireplace just won’t […]
Continue reading...
In the Google Chrome Browser Open Developer tools with right click and “Inspect” Open the Command Control: <ctrl><shift><p> (Windows) or <cmd><shift><p> Type “Show rendering” Set the Emulate CSS media feature prefers-color-scheme to the value you want to debug While you are here, have some CSS…
Continue reading...
If you want to programmatically insert a post in the front end, for example based on user input, there is a danger that the user can resubmit the form and post it twice. WordPress has the function post_exists to prevent that. But it is an admin function and if you try using it in the […]
Continue reading...
For one of my apps, I have a landing page website – ourchurchapp.online, that detects if a mobile phone or tablet has accessed it and redirects to the correct app store. I use a javascript function to detect iOS, Android, Windows and Amazon – although Windows doesn’t go anywhere – so few people use it […]
Continue reading...
What a pain in the neck! I tried Mailhog and just couldn’t it working on my M1 Mac Mini, so I’ve gone down the Postfix route and got it working and diverting all emails to one email address. You are going to be using the Terminal (which is in Applications > Utilities) Open that up […]
Continue reading...
If you need to send a post or page out via email, you will need to parse blocks and shortcodes first. I use MailChimp and the API doesn’t like audio and video tags. This function takes the post content and parses it creating buttons for playing audio and video. In the switch($block[‘blockName’]) you can add […]
Continue reading...
If you want tables in the admin area of your plugin to be responsive, here’s the basic markup… The is-expanded class is added by the WordPress API when the downward arrow button is clicked.
Continue reading...
If weird characters suddenly appear on your blog posts and pages. Don’t panic. You may see Don’t instead of Don’t for instance. This can happen when a database is restored or updated because the character set has been changed Here are some common examples… “ = left quote = “†= right quote = ” […]
Continue reading...