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 | |
## Truncate Post | |
function custom_excerpt_length(){ | |
global $excerpt_length; | |
return $excerpt_length; | |
} | |
function custom_excerpt_more(){ | |
global $excerpt_more; |
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 | |
add_shortcode('map', 'location_map'); | |
function location_map($atts){ | |
$urlp = parse_url($atts['address']); | |
$q = parse_str($urlp['query']); | |
if(!empty($q['q'])){ | |
return '<a href="'.$atts['address'].'"><img src="http://maps.google.com/maps/api/staticmap?center='.$q['q'].'&zoom=14&size='.$atts['w'].'x'.$atts['h'].'&maptype=roadmap&markers='.$q['q'].'&sensor=false" class="map" /></a>'; | |
} | |
} |
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
<script> | |
post_ids = <?php echo json_encode(array(185,4,171)); ?>; | |
$(document).ready(function(){ | |
/* Put your jQuery here */ | |
$('.post-'+post_ids[1]).hide(); | |
$('.post-'+post_ids[2]).hide(); | |
$('.click'+post_ids[0]).addClass('active'); | |
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 | |
/* | |
** $taxonomy = Taxonomies to retrieve terms from | |
** $tax = Term slug or id to test against | |
*/ | |
function in_tax($taxonomy, $tax){ | |
global $post; | |
$taxes = array(); | |
if(is_int($tax)){ | |
$terms = wp_get_object_terms($post->ID, $taxonomy, array('fields' => 'ids')); |
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 | |
## Rewrite rules | |
add_filter( 'page_rewrite_rules','gcc_insert_rewrite_rules' ); | |
add_filter( 'query_vars','gcc_insert_query_vars' ); | |
add_action( 'wp_loaded','gcc_flush_rules' ); | |
// flush_rules() if our rules are not yet included | |
function gcc_flush_rules(){ | |
$rules = get_option( 'rewrite_rules' ); |
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 | |
Client::model()->findAll(array( | |
'non_disclosure=:non_disclosure', | |
'questionnaire=:questionnaire', | |
'mod=:mod', | |
'initial_deposit=:initial_deposit', | |
), | |
array( | |
':non_disclosure' => 0, | |
':questionnaire' => 0, |
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 | |
add_filter('template_include', 'export_perms'); | |
function export_perms(){ | |
$posts = get_posts(array( | |
'post_type' => array('post', 'page'), | |
'numberposts' => -1, | |
)); | |
$perms = ''; | |
foreach($posts as $post){ | |
setup_postdata($post); |
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 arr_sort_by_column($arr_data, $str_column, $bln_desc = false) | |
{ | |
$arr_data = (array) $arr_data; | |
$str_column = (string) trim($str_column); | |
$bln_desc = (bool) $bln_desc; | |
$str_sort_type = ($bln_desc) ? SORT_DESC : SORT_ASC; | |
foreach ($arr_data as $key => $row) | |
{ |
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 get_header(); ?> | |
<div class="row"> | |
<?php | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
$big_video = get_post_custom_values('Big_Video'); |
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 js_add_review($content) { | |
global $post; | |
$original = $content; | |
$content = js_ratings_box(); | |
$content .= $original; | |
return $content; | |
} | |
add_filter( 'the_content', 'js_add_review', 15 ); |
OlderNewer