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
/** | |
* Change the placeholder image | |
*/ | |
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); | |
function custom_woocommerce_placeholder_img_src( $src ) { | |
$upload_dir = wp_upload_dir(); | |
$uploads = untrailingslashit( $upload_dir['baseurl'] ); | |
// replace with path to your image | |
$src = $uploads . '/2012/07/thumb1.jpg'; |
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
/** | |
* Filter Genesis H1 Post Titles to add <span> for styling | |
* | |
*/ | |
add_filter( 'genesis_post_title_output', 'filter_genesis_post_title_tags', 15 ); | |
function filter_genesis_post_title_tags( $title ) { | |
if ( is_singular() ) | |
$title = sprintf( '<h1 class="entry-title"><span>%s</span></h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) ); |
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 a custom feed to WordPress. | |
* | |
* The feed will be rendered through the wp-includes/feed-rss2.php template | |
* and avaiable under example.com/feed/{$feed_slug}. | |
* | |
* Note: Don't forget to flush the rewrite rules once. | |
* | |
* @author Dominik Schilling |
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( 'wp_nav_menu_items', 'add_search_genesis_menu', 10, 2 ); | |
function add_search_genesis_menu( $menu, $args ) { | |
if ( 'primary' !== $args->theme_location ) | |
return $menu; | |
ob_start(); | |
get_search_form(); | |
$search = ob_get_clean(); | |
$menu .= '<li class="search">' . $search . '</li>'; |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Customize the credits | |
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' ); | |
function sp_footer_creds_text() { | |
echo '<div class="creds"><p>'; | |
echo 'Copyright © '; | |
echo date('Y'); | |
echo ' · <a href="http://mydomain.com">My Custom Link</a> · Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</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
// Customize the post info function | |
add_filter( 'genesis_post_info', 'post_info_filter' ); | |
function post_info_filter($post_info) { | |
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; | |
return $post_info; | |
} | |
// Remove the post info function | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); |
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_action( 'loop_start', 'display_users_ip_address' ); | |
function display_users_ip_address() { | |
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
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: Custom Blog | |
genesis(); |
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
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> |
NewerOlder