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 get_the_terms( $post, $taxonomy ) { | |
| if ( ! $post = get_post( $post ) ) | |
| return false; | |
| $terms = get_object_term_cache( $post->ID, $taxonomy ); | |
| if(false === $terms || empty($terms)){ | |
| $terms = wp_get_post_terms( $post->ID, $taxonomy ); | |
| if ( ! is_wp_error( $terms ) ) { |
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 mb_trim($str) { | |
| static $chars = "[\\x0-\x20\x7f\xc2\xa0\xe3\x80\x80]"; | |
| return preg_replace("/\A{$chars}++|{$chars}++\z/u", '', strip_tags($str)); | |
| } | |
| $content = mb_trim(get_the_content()); | |
| if($content === ""){ | |
| echo '<p>Empty Content</p>'; | |
| }else{ |
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
| jQuery(function(){ | |
| var wrap = "#" + thisPanelId + ' .postcontent-inner'; | |
| var wrapHeight = jQuery(wrap).outerHeight(true); | |
| var container = "#" + thisPanelId + ' .postcontent-box'; | |
| var target = "#" + thisPanelId + ' .postcontent-box .sec-post'; | |
| var offset = wrapHeight * 0.25; // 25% Height | |
| jQuery(target).first().addClass("inview"); | |
| jQuery(target).each(function(){ | |
| var pTop = jQuery(this).position().top - wrapHeight + offset; | |
| var pBtm = jQuery(this).position().top + jQuery(this).outerHeight(true) - offset; |
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 | |
| $array = array( | |
| '1/10/2014', | |
| '1/11/2014', | |
| '1/12/2014', | |
| '1/13/2014', | |
| '1/14/2014' | |
| ); | |
| $array = array_filter($array,function($date){ |
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 get_prev_post_cf($link="« %link", $title="%title", $post_type="post", $meta_key, $meta_value, $label) { | |
| global $wpdb, $post; | |
| $prev = $wpdb->get_row($wpdb->prepare(" | |
| SELECT ID, post_title | |
| FROM $wpdb->posts p | |
| LEFT OUTER JOIN $wpdb->postmeta pm on p.ID = pm.post_id | |
| WHERE post_type = '{$post_type}' | |
| AND post_status = 'publish' | |
| AND post_date < '".$post->post_date."' |
NewerOlder