This file contains 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 add_category_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
register_taxonomy_for_object_type('category', $post_type); | |
} | |
} | |
add_action( 'init', 'add_category_support', 99 ); |
This file contains 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 findMiddleDiv(){ | |
var scrollTop = $(window).scrollTop(); | |
var winHeight = $(window).height(); | |
var middleHeight = winHeight / 2; | |
var visibleElements = $('.platform-section'); | |
var $midElement = visibleElements.eq(0); | |
var targetId, |
This file contains 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 | |
/** | |
* Default Img for post thumbnails | |
* | |
* @param $file_name_new (string) Name of the newly-created file | |
* @param $file_name_orig (string) Filename of the original default image | |
* @param $post_id (int) ID of the associated Post | |
* @param $size (array) Width/height of cropped thumbnail | |
* @param $class (string) Optional class attribute for output image |
This file contains 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 | |
/** | |
* Hide certain links from edit.php | |
* | |
* @param array $actions Array of action links | |
* @return array $actions Filtered array of links | |
*/ | |
function remove_row_actions( $actions ) { |
This file contains 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 | |
/** | |
* Build a link to Google Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. |
This file contains 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 | |
/** | |
* Build a link to Bing Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. | |
*/ |
This file contains 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 | |
/** | |
* Hide email from Spam Bots using a shortcode. | |
* | |
* @param array $atts Shortcode attributes. Not used. | |
* @param string $content The shortcode content. Should be an email address. | |
* | |
* @return string The obfuscated email address. | |
*/ | |
function _ss_hide_email_shortcode( $atts , $content = null ) { |
This file contains 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 | |
/** | |
* Build a Static Map link to Google Maps | |
* | |
* @since 1.0 | |
* | |
* @param string $lat the requested Latitude of the location. Required, default is empty. | |
* @param string $lng the requested Longitude of the location. Required, default is empty. | |
* @return mixed The url if successful. Empty otherwise. |
This file contains 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 | |
// Create a dynamic id on body elements | |
function get_body_id( $id = '' ) { | |
global $wp_query; | |
// Fallbacks | |
if ( is_front_page() ) $id = 'front-page'; | |
if ( is_home() ) $id = 'blog'; | |
if ( is_search() ) $id = 'search'; | |
if ( is_404() ) $id = 'error404'; |
This file contains 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
add_action( 'parse_request', 'check_for_redirect' ); | |
function check_for_redirect( $query ) { | |
if( is_admin() ){ | |
return; | |
} | |
if( isset($query->query_vars[ 'pagename' ]) ){ | |
$pagename = $query->query_vars[ 'pagename' ]; |