This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_term_top_most_parent($term_id, $taxonomy){ | |
| // start from the current term | |
| $parent = get_term_by( 'id', $term_id, $taxonomy); | |
| // climb up the hierarchy until we reach a term with parent = '0' | |
| while ($parent->parent != '0'){ | |
| $term_id = $parent->parent; | |
| $parent = get_term_by( 'id', $term_id, $taxonomy); | |
| } | |
| return $parent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * RedirectWPRegister() | |
| * Redirect from Default wordpress register page to custom register page. | |
| */ | |
| function RedirectWPRegister(){ | |
| $request = basename($_SERVER['REQUEST_URI']); | |
| if ($request == 'wp-login.php?action=register'): | |
| wp_redirect(site_url('/?page_id=776')); | |
| exit(); | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #----------------------------------------------------------------- | |
| # Checks if a particular user has a role. | |
| # Returns true if a match was found. | |
| # | |
| # @param string $role Role name. | |
| # @param int $user_id (Optional) The ID of a user. Defaults to the current user. | |
| # | |
| # @return bool | |
| # | |
| #----------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;HTC Wildfire | |
| %SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C8B | |
| %CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C8B&MI_01 | |
| %SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'), | |
| gutil = require('gulp-util'), | |
| sass = require('gulp-sass'), | |
| csso = require('gulp-csso'), | |
| uglify = require('gulp-uglify'), | |
| concat = require('gulp-concat'); | |
| gulp.task('css', function () { | |
| gulp.src('./_includes/css/*.scss') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #----------------------------------------------------------------- | |
| # Check if a Page is a Child of Another Page in WordPress | |
| # Returns true if a match was found. | |
| # | |
| # @param int $pageID | |
| # | |
| # @return bool | |
| # | |
| #----------------------------------------------------------------- | |
| function is_childPage($pageID) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} !^www\. | |
| RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RewriteEngine On | |
| RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC] | |
| RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function redirectTohttps() { | |
| if($_SERVER['HTTPS']!=”on”) { | |
| $redirect= “https://”.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
| header(“Location:$redirect”); | |
| } | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Apache Configuration File | |
| # (!) Using `.htaccess` files slows down Apache, therefore, if you have access | |
| # to the main server config file (usually called `httpd.conf`), you should add | |
| # this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html. | |
| # ############################################################################## | |
| # # CROSS-ORIGIN RESOURCE SHARING (CORS) # | |
| # ############################################################################## |