Error validating verification code. Facebook Error

`Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request`. If you are getting this error from Facebook, just add trailing slash at the end of your redirect_uri ~~~ $redirect_uri = rtrim(redirect_uri,”/”).’/’; ~~~

Modify WordPress v4.4 + header title

As we all know `wp_title()` is being deprecated as of WordPress 4.4. it is recommended that you instead use its replacement: [the title-tag theme]( feature. Here’s the WordPress filter to modify the header initiated by `wp_get_document_title`. Replace whole title tag with pre_get_document_title filter: ~~~ add_filter( ‘pre_get_document_title’ , ‘render_title’ ); function render_title($title){ return ‘New title ‘; } ~~~ Or with `document_title_parts` get more creative. ~~~ add_filter( ‘document_title_parts’ , ‘render_title’ ); function render_title($parts){ $parts[“title”] = “My Prefix “. $parts[“title”]; return $parts; } ~~~ I would love to hear other improved ways to do this, hope it helps!

Generate Date of Birth Select inputs Dynamically PHP

There are times when you need to insert date of birth input box in your HTML form. Here’s small PHP snippet to dynamically populate the HTML `SELECT ` element with Date of Birth for you. Just copy and use in your projects. ~~~ //year echo ‘‘; for($i = date(‘Y’); $i >= date(‘Y’, strtotime(‘-90 years’)); $i–){ echo “$i“; } echo ‘‘; //month echo ‘‘; for($i = 1; $i

Adding Imagick Text Shadow in PHP

This example code shows how you can add text shadow to your texts using Imagick draw. The idea is to create two sets of texts using `annotateImage()`, first one is the shadow and another one is the text. We just move shadow text `x` and `y` position by 1 pixel to the east-south to achieve that shadow effect. This is a very basic example if you have some advance example please do share : ~~~ ~~~