How to add custom taxonomies in WordPress without plugins
In the same vein of our previous post about creating a Custom Post Type without plugins, here we’ll see how to create custom taxonomies. In this example we create two taxonomies (director and year) to...
View ArticleCreating a Bootstrap carousel with multiple posts per item in WordPress
The below code generates a Bootstrap carousel with multiple WordPress posts per slide using get_posts() loop. It groups all the posts in group of 4, then generate the slides/items. Check the comments...
View ArticleWordPress: changing the status code on AJAX response
Use the following code in WordPress for changing the HTTP status code returned from an AJAX call, e.g. setting a 400 – Bad Request error: function my_ajax() { status_header(400); echo 'Some return...
View ArticleLumen: get the full url containing the query string
In Lumen (the micro-framework by Laravel) the following code will return the full url containing also the query string: public function someMethod(Request $request) { // Get the full url...
View ArticleLumen: getting an url parameter within a Blade view
The following code can be used in Lumen, within a Blade view, in order to get the current value of a url parameter: {{ app('request')->input('name') }} Where name is the url parameter name. Example...
View ArticlePHP: a function for building an HTML calendar
The below function is a modified version of the one from David Walsh Blog. You can get the original one from this very good post. This PHP function will return an HTML calendar (built using the table...
View ArticlePHP: getting latest Tweets and displaying them in HTML
This post shows how you can get the latest Tweets from a Twitter account and displaying them in HTML, with links for all the entities (urls, hashtags, user mentions, etc). Create a Twitter App You must...
View ArticleAdd PHP libraries to Laravel projects
If you want to add an additional PHP library in your Laravel projects just follow these two steps: 1. Add the library with composer For example, here we add the Facebook SDK library: $ composer require...
View ArticleResolve mcrypt and intl module errors installing Magento 2 with Composer on Mac
Installing Magento 2 on Mac El Capitan OS X 10.11 using Composer you could get errors like: The requested PHP extension mcrypt is missing from your system The requested PHP extension intl is missing...
View ArticleGet product attribute in checkout page in Magento 1.9
There are several ways to do it but this is the best one. Add your attribute in app/etc/configs.xml: <global> <sales> <quote> <item> <product_attributes>...
View Article