Remove the prepended ‘Category:’ or ‘Archive:’ when trying to echo the name of the archive in WordPress.
In my WordPress site, I had a need to list all taxonomies and underneath them, their related custom post types.
To do this, I used this code below. Obviously replace “custom_taxomy” with your taxonomy name and “custom_post_type” with your post type name.
Sometimes it can look good to gradually fade in a page on website load. It gives a page a nicer feel.
Adding JS to WordPress can be done in two ways. The first way is to enqueue the JS file.
The second way can be done by adding inline JS via a hook in functions.php – this is most likely used to initialize a script that is enqueued or add Google Tracking codes, Facebook pixels etc.
Implement FontAwesome Pro in CSS using Pseudo elements, it comes in handy when creating drop down menus, etc.
Change the font weight based on the library you are using.
Eg if you are using Font Awesome Light, use weight of 300.
I was working on a project using VueJS and was using this datepicker which is a great vue plugin.
However, when sending the date to the database in Laravel, it posts as ISO8601 format (eg. 1996-10-15T00:05:32.000Z)
MySQL doesn’t like that format, so we need to convert it to the correct date time format so MYSQL can store it.
To do it, we use Carbon. Carbon comes with Laravel which is awesome, so we can just import Carbon into our controller and make it work.
Working on a project for a customer using Laravel 5.8, I found that when uploading files to S3 using Laravel’s Fly System, that the uploads were failing after a certain size.
The error back was a validation error mentioning the file was unable to be uploaded.
To troubleshoot this, there were a few things I did:
- Ensured my PHP.INI settings were allowing uploads high enough. I found that PHP.INI only allows 2M by default, so I increased this limit to 20M. I also increased the max post time to 300.
- I found out that Amazon S3 doesn’t like files over 5 MB uploading in one go, instead you need to stream it through
Streaming the files
My solution was to have the file upload to the server first, and once it is uploaded, it is streamed from the server to S3.