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 | |
/** | |
* @package WordPress | |
* @subpackage Adapt Theme | |
*/ | |
?> | |
<?php get_header(); ?> | |
<?php | |
// Load isotope scripts |
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
if ( !function_exists( 'wpex_excerpt' ) ) { | |
function wpex_excerpt($length=30, $readmore=false ) { | |
global $post; | |
$id = $post->ID; | |
$meta_excerpt = get_post_meta( $id, 'wpex_excerpt_length', true ); | |
$length = $meta_excerpt ? $meta_excerpt : $length; | |
if ( has_excerpt( $id ) ) { | |
$output = apply_filters( 'the_content', $post->post_excerpt ); | |
} else { | |
$excerpt = get_the_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_action('init','set_post_thumbnails'); | |
function set_post_thumbnails() { | |
// Query args | |
$args = array( | |
'post_type' => 'testimonials', | |
'posts_per_page' => '-1' | |
); | |
// Run query | |
$query = new WP_Query( $args ); |
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
update_post_meta( get_the_ID(), '_product_image_gallery', '' ); |
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
// Remove WooCommerce menu.css on WP 3.8+ | |
add_action( 'admin_print_styles', 'wpex_remove_woocommerce_admin_menu_styles' ); | |
if ( ! function_exists('wpex_remove_woocommerce_admin_menu_styles') ) { | |
function wpex_remove_woocommerce_admin_menu_styles() { | |
global $wp_version; | |
if ( $wp_version >= 3.8 ) { | |
wp_dequeue_style( 'woocommerce_admin_menu_styles' ); | |
} | |
} | |
} |
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
/** | |
* Remove the slug from published post permalinks. Only affect our CPT though. | |
*/ | |
function wpex_remove_post_type_slug( $post_link, $post, $leavename ) { | |
if ( ! in_array( $post->post_type, array( 'YOUR_POST_TYPE' ) ) || 'publish' != $post->post_status ) | |
return $post_link; | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); | |
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
if ( ! function_exists( 'wpex_next_prev' ) ) { | |
function wpex_next_prev() { | |
// Not singular so bye bye! | |
if ( !is_singular() ) return; ?> | |
<div class="clr"></div> | |
<ul class="post-pagination clr"> | |
<?php previous_post_link( '<li class="post-next">%link<span>→</span></li>', true ); ?><?php next_post_link( '<li class="post-prev"><span>←</span>%link</li>', true ); ?> | |
</ul><!-- .post-post-pagination --> | |
<?php } | |
} |
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_action('init', 'wpex_move_terms'); | |
function wpex_move_terms() { | |
$terms = get_terms( 'category', array('child_of'=>'142')); | |
foreach ($terms as $term) { | |
wp_insert_term( $term->name, 'wpex_theme_category', array( | |
'slug' => $term->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
if ( color ) { | |
$('#' + mainID + ' .typography-preview').css('color', color); | |
$('#' + mainID + ' .typography-preview').css('background-color', getContrastColour(color)); | |
$('#' + mainID + ' .redux-typography-font-family').val(output); | |
$('#' + mainID + ' .typography-style .select2-chosen').text($('#' + mainID + ' .redux-typography-style option:selected').text()); | |
$('#' + mainID + ' .typography-script .select2-chosen').text($('#' + mainID + ' .redux-typography-subsets option:selected').text()); | |
} |
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
if ( is_tax() ) { | |
$obj = get_queried_object(); | |
$taxonomy = $obj->taxonomy; | |
$term_id = $obj->term_id; | |
$description = term_description($term_id,$taxonomy); | |
if ( ! empty( $description ) ){ | |
$output .= '<div class="clr page-subheading term-description">'; | |
$output .= $description; | |
$output .= '</div>'; | |
} |