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
    
  
  
    
  | add_filter('the_content_feed', 'rss_post_thumbnail'); | |
| function rss_post_thumbnail($content) { | |
| global $post; | |
| if( has_post_thumbnail($post->ID) ) | |
| $content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content; | |
| return $content; | |
| } | 
  
    
      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
    
  
  
    
  | add_filter('widget_text', 'enable_php_code', 99); | |
| function enable_php_code ($text) | |
| { | |
| if (strpos($text, '<' . '?') !== false) | |
| { | |
| ob_start(); | |
| eval('?' . '>' . $text); | |
| $text = ob_get_contents(); | |
| ob_end_clean(); | 
  
    
      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
    
  
  
    
  | // Temp Maintenance - with http response 503 (Service Temporarily Unavailable) | |
| // This will only block users who are NOT an administrator from viewing the website. | |
| function wp_maintenance_mode() | |
| { | |
| if(!current_user_can('edit_themes') || !is_user_logged_in()) | |
| { | |
| wp_die('Maintenance, please come back soon.', 'Maintenance - please come back soon.', array('response' => '503')); | |
| } | |
| } | 
  
    
      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 showalltags() { | |
| $tags = get_tags(); | |
| $html; | |
| foreach ($tags as $tag){ | |
| $tag_link = get_tag_link($tag->term_id); | |
| $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>"; | 
  
    
      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
    
  
  
    
  | define( 'MEDIA_TRASH', true ); | 
  
    
      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 | |
| // start the session | |
| session_start(); | |
| // if there's a "lang" parameter in the URL... | |
| if( isset( $_GET[ 'lang' ] ) ) { | |
| // ...set a session variable named WPLANG based on the URL parameter... | |
| $_SESSION[ 'WPLANG' ] = $_GET[ 'lang' ]; | |
  
    
      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
    
  
  
    
  | // ----------- | |
| // Debugger that shows view port size. Helps when making responsive designs. | |
| // ----------- | |
| function showViewPortSize(display) { | |
| if(display) { | |
| var height = jQuery(window).height(); | |
| var width = jQuery(window).width(); | |
| jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
| jQuery(window).resize(function() { | 
  
    
      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
    
  
  
    
  | public function custom_create_user($user_name, $first_name, $last_name, $email_address, $user_role = 'subscriber') | |
| { | |
| $user_id = username_exists( $user_name ); | |
| if( $user_id != null ) | |
| { | |
| throw New Exception('Username already exists!'); | |
| } | |
| if ( email_exists($email_address) == true ) | 
  
    
      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() { | |
| //Check to see if the window is top if not then display button | |
| $(window).scroll( function() { | |
| if ($(this).scrollTop() > 100) { | |
| $('#scroll-top').fadeIn(); | |
| } else { | |
| $('#scroll-top').fadeOut(); | |
| } | |
| }); | 
  
    
      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_top_parent_page_id() { | |
| global $post; | |
| $ancestors = $post->ancestors; | |
| // Check if page is a child page (any level) | |
| if ($ancestors) { | |
| // Grab the ID of top-level page from the tree |