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
/** | |
* Allows site tagline/description to render HTML tags | |
*/ | |
add_filter( 'genesis_seo_description', 'ja_allow_HTML_to_site_tagline', 10 ,3 ); | |
function ja_allow_HTML_to_site_tagline( $description, $inside, $wrap ){ | |
$inside = html_entity_decode( get_bloginfo( 'description' ) ); | |
//* Build the description | |
$description = genesis_html5() ? sprintf( "<{$wrap} %s>", genesis_attr( 'site-description' ) ) : sprintf( '<%s id="description">%s</%s>', $wrap, $inside, $wrap ); |
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
/* Set group for all customers who purchased in the shop | |
* The customer will automatically assign to a group once the order is complete | |
* This code requires "Woocommerce", "Groups" and "Groups Woocommerce" plugin | |
*/ | |
add_action( 'woocommerce_order_status_completed', 'ja_order_status_completed', 100 ); | |
function ja_order_status_completed( $order_id ) { | |
if ( $order = Groups_WS_Helper::get_order( $order_id ) ) { | |
if ( $items = $order->get_items() ) { | |
if ( $user_id = $order->user_id ) { |
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
// Transfer featured image/video above the post title | |
// Show featured image on archive/blog page and video on single post page | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
add_action( 'genesis_before_entry', 'ja_do_post_image_or_video', 8 ); | |
function ja_do_post_image_or_video() { | |
global $post; | |
// Get the new custom field value | |
$video_iframe = get_post_meta( $post->ID, 'single_post_video', true ); |
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 Post Views on Post Info | |
add_filter( 'genesis_post_info', 'ja_add_post_view_to_info' ); | |
function ja_add_post_view_to_info($post_info) { | |
if ( !is_page() ) { | |
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [postview] [post_edit]'; | |
return $post_info; | |
} | |
} | |
// Add Post Views on Post Meta |
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 Post Views on Genesis Framework | |
/** | |
* Set Post Views | |
* It counts everytime single posts is viewed | |
*/ | |
if ( !function_exists( 'ja_setPostViews' ) ){ | |
function ja_setPostViews( $postID ){ | |
$count_key = 'ja_post_views'; | |
$count = get_post_meta($postID, $count_key, true); |
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
/* | |
* Custom Archive Page CSS | |
*/ | |
.ja_archive_page{ | |
display: block; | |
margin-bottom: 30px; | |
overflow: hidden; | |
} | |
.ja_archive_page ul{ |
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 | |
/** | |
* Template Name: Archive | |
*/ | |
/** Force full width layout */ | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
//* Remove standard post content output | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); |
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 | |
/** | |
* Display Product Category Custom Meta Field | |
*/ | |
$product_categories = get_terms( 'product_cat' ); | |
foreach ( $product_categories as $category ) { | |
echo $category->meta['product_category_size']; | |
} | |
?> |
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 Custom Meta Fields in Product Category | |
*/ | |
if (class_exists( 'Woocommerce' )) { | |
function ja_taxonomy_custom_meta_field(){ | |
add_action( 'product_cat_edit_form', 'ja_product_cat_field', 9 ); | |
} | |
add_action( 'admin_init', 'ja_taxonomy_custom_meta_field' ); |
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_filter( 'get_the_excerpt', 'ja_custom_excerpt' ); | |
add_filter( 'the_excerpt', 'ja_custom_excerpt' ); | |
function ja_custom_excerpt( $excerpt ){ | |
$custom_excerpt = substr( $excerpt , 0, 20); | |
return $custom_excerpt; | |
} |
NewerOlder