Archie Makuwa's Blog

Author: Archie Makuwa (page 1 of 14)

LearnDash – Auto enroll users

Recently, a client of mine wanted to run a promotion on some of his online courses. He wanted to get users to signup, and then automatically enrolled to a certain course/courses:

The solution was relatively easy:

You can run the snippet straight, within another function or a function its own, as indicated above.

Overwrite WordPress’ wp_admin from email address

Have you ever wanted to change the “from:” in WordPress using the CODE? See below for a quick solution (snippet).

 

Using HTML5 Web Storage

What is HTML5 Web Storage?

With web storage, web applications can store data locally within the user’s browser.

Before HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance.

Unlike cookies, the storage limit is far larger (at least 5MB) and the information is never transferred to the server.

Web storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.

Browser Support

The following web browsers supported:

  • Google Chrome 4.0 +
  • Internet Explorer 8.0 +
  • Firefox 3.5 +
  • Safari 4.0 +
  • Opera 11.5 +

Usage Examples

HTML web storage provides two objects for storing data on the client:

  • window.localStorage – stores data with no expiration date
  • window.sessionStorage – stores data for one session (data is lost when the browser tab is closed)

I also recently used the script to load a popup video once on a website. The video will not load again unless the session is terminated somehow (closing browser tab or moving away from the site). I used Fancybox2 in this example – look, this is really some basic shit but you get the idea.

 

 

Why I haven’t posted anything in 1 year and 6 months

I know I don’t have any following on social media or anywhere else – not even on this blog. I am sharing this for the sake of sharing.

My last blog post was on the 22 December in 2016 which was around the same time I left a full-time job at Tenacity Works in Cape Town to start a journey on my own.

I have been kept busy ever since juggling shit I never thought I would be juggling some day. I became a boyfriend, an accountant, a salesman, a system administrator, a developer, a technician and I became *fat in the process. In the process, I also attracted a lot of bad business partners – the guys who would call on a Saturday and disturb the peace.

So… I haven’t really had enough time to do stuff that matters, like losing weight, being a good boyfriend, blogging, hiking and so forth. I have made a commitment though to start making the time, so keep watching this space, my Twitter or Instagram.

 

*fat – currently the scale is standing at 115kg (I am overweight)

Automatically remove a canceled order in WooCommerce [UnTested]

Based on a question on StackExchange, please find a solution below. We have not tested this, but it was a quick solution by: the_dramatist and kinda looks right. Please test!

 

Convert all WordPress status from Trash to Drafts

Have you ever found yourself in a situation where you have to covert hundreds and hundreds of posts from the Trash folder into Drafts?

You can easily execute that using one easy mySQL query:

 

Open all external links and PDFs in an external window or tab using jQuery

This is how you would open all external links and PDFs in an external window or tab using jQuery.

Now leave me alone…

Change local server time using php.ini on a shared hosting environment

Have you ever been a cheapskate and opted for a shared hosting environment in a foreign country merely because it was cheaper? Haver you ever been frustrated for not being able to control the server system time because obviously, that is not your server?

Cheapskate – A stingy person. Somebody who buys cheap in favour of higher quality or better stuff. Even though they might be able to afford the better. Perhaps ungenerously trying not to spend much on their friends. Not particularly offensive, and often intended to ridicule in a light-hearted manner. North American origin (skate apparently meaning fellow).

 

Well the good news is you can use the php.ini file in your shared hosting account to take control of the server local time as follows:

A list of supported time zones: http://php.net/manual/en/timezones.php

E.g:

Wrap colorbox main div into another Raw

The last time I worked with the Colorbox library was during my “hardcore” Drupal7 days and that was many months ago. I recently found myself creating galleries, pop-ups and so forth over the past 48 hours using jQuery ColorBox: http://www.jacklmoore.com/colorbox/

If you have ever wanted to know how you could easily wrap the colorbox main div with another div, this is how easy it is to do that:

 

Importing a web font using @font-face in shopify’s liquid Raw

 

Olderposts

Copyright © 2018 Archie Makuwa's Blog

Theme by Anders NorenUp ↑