OceanWP Header background image black

Did you try to control this with a function?
And did it stop working recently and is now only showing a blacked out area?
Did you use the hook ocean_page_header_background_image and the function as posted in the OceanWP docs?

Well… Just change your script to give back the image ID instead of the URL:

if ( is_singular( 'post' ) ) {
  // $bg_img = get_stylesheet_directory_uri() . '/img/my-image.jpg';
  $bg_img = 1394;
}

You’re welcome.
Have a nice day!

PS.
Also posted to support hoping maybe OceanWP can fix this, so we can use the image filename/URL again?

PHP8 and function list() = each()

Time to write something about PHP again. With PHP 7.2, the function each() is deprecated. The documentation says: “Warning This function has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged.“.
If you ignored this warning before, in PHP8 you will now get the following error: Fatal error: Uncaught Error: Call to undefined function each() in /path/file.php:line
So, what do you do when you find this in your old code or in some library that you use, but is not being updated anymore? Stackoverflow to the rescue…

Continue reading PHP8 and function list() = each()

NordVPN 3 year plan discount

Even though I get no commission, I would like to share a discountcode to get a better offer for NordVPN.
My subscription was up for renewal, but the renewal-offer was way more expensive per month, so I cancelled the subscription. Now after it expired I went back to the NordVPN website to see if the price was any better, but unfortunately they only offered a month, year or 2-year plan. I started searching and fount the following discount code, with the added bonus of getting a three year plan in the process.

Use this discount code:

Continue reading NordVPN 3 year plan discount

Thunderbird 115 Calendar View scaled wrong

Ever since the latest upgrade of Thunderbird mailclient to version 115 many people have experienced problems. It started with the setting being changed to compact for the density of the mailbox views. That solution was simple; just change in your menu “View – Density” and change it back to ‘default‘.

However the view of the calendar has been giving problems. The right-hand-side of it is outside of the visible window, basically dropping off the date from the view; see screenshot and yes, that is to the edge of my screen with Thunderbird maximized.

So, how do we solve this?
Go to “Tools – Settings – General” and at the bottom open the ‘Config Editor…’
Now search for ‘layout.css.devPixelsPerPx‘ and change that value to 0.9
Since this scales everything on the screen, you may want to increase your font-size next:
Go to “View – Font Size – Increase Font Size”, and see the second screenshot for the result.
Good luck!

That’s all Folks!
Have a nice day…

How to encode and decode Base64 in VB.NET

Because sometimes you just need a string with ‘normal characters’ instead of funky ones…

Public Function EncodeBase64(input As String) As String
	Return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(input))
End Function

Public Function DecodeBase64(input As String) As String
	Return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(input))
End Function

Have a nice day!

Accessing an old router

Would be a waste to toss an old wifi router that still works…
However it could be a problem to access the admin page because the HTML presenting it is so old that it just won’t show up in a modern browser. It just will not render correctly, tabs empty, buttons and links don’t show.
So, google to the rescue and land here.

My issue was with a Sitecom WL153 but the solution presented simply worked.

“My solution was to download and use an old version of Firefox Portable – no installation required and can run as an unprivileged user. I would suggest you search around for which versions of the browsers will work with your devices.”

For me the 2013 version of Firefox 25 worked like a charm…
Problem solved!

Have a nice day!