Shortcodes do not work in WordPress post excerpts by default, but you can easily make your post excerpts shortcode compatible by using the function described in this post. Read On…
Custom Buddypress Permalink and Members URL Slugs
Customizing the buddypress slug can be done without any code update. First for clarity purpose, what I am talking here is changing the the base buddypress slug like :
http://www.fiazhuysn.com/members/fiazhusyn/ to https://fiazhusyn.com/ninja/fiazhusyn/
friends_check_friendship_status() – BuddyPress Function Reference

Description
Checks if two users are friends. This buddypress function is used to check the friendship status of two users. It returns the friendship status as a string.
bp_loggedin_user_domain() – BuddyPress Function Reference

Description
bp_loggedin_user_domain() returns the profile URL of currently logged-in user. This function comes in handy while dynamically building up the URLs for currently logged in user.
Flushing Custom Permalink Structure for Custom Post Type
Custom post types are a powerful feature of WordPress, however if you are using custom permalink with custom post type, You may end up getting 404. The simple solution is flushing the rewrite rules.
Using Shortcode in WordPress Post Excerpts
Shortcodes were introduced in WP version 2.5 primarily for use in post content. They were not meant for post excerpts nevertheless you can easily add the shortcode capability to your post’s excerpts.
Minimum length validation with Abide in Foundation
To validate minimum length of an input while using Abide in Foundation Framework. Use the following regular expression “(.){8,}” Where 8 is the number of minimum characters that should be present.
The use of this expression is further explained through the example below. The aim of validation in the example is to have password of minimum 8 characters:
1 2 3 4 5 6 7 8 9 |
$(function(){ $(document).foundation({ abide: { patterns: { password: /^(.){8,}$/ } } }); }); |
Display Website Visitor’s Current Location using Google Maps

One of my client wanted to display the current visitor’s location on his website. So I coded a simple script to get the visitor’s location through HTML GeoLocation API and subsequently plot the location on Google Maps. Its a simple and handy code which I have decided to share over here.
Function Reference / get_results – ezSQL

Description
get_results is a method of ezSql Class and it is used to retrieve multiple row results. This function returns the entire query result as an array. Each element of this array corresponds to one row of the query result and like get_row (ezSql), can be an object, an associative array, or a numbered array.
If no matching rows are found, or if there is a database error, the return value will be an empty array. If your $query string is empty, cached result from last query are returned and if you pass an invalid $output_type,nothing will be returned.
Your theme does not declare WooCommerce support
If you are using an older theme, you may see this error “Your theme does not declare WooCommerce support” in WordPress admin dashboard. Simply add the following line in functions.php file of your theme.
1 |
add_theme_support('woocommerce'); |
Method Reference / get_row – ezSQL

Description
Use get_row to retrieve a single row from database. If there is more than one row returned by query still this function returns only one row which will be either first row or any row specified through $row_offset variable. This function can return row as an object, an associative array, or as a numerically indexed array.
get_row returns NULL, if no result is found.