Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
@frankschrijvers
frankschrijvers / style.css
Last active April 21, 2016 13:55
Styling custom author box genesis
.author-box {
background: #f5f5f5;
}
.author-box .author-social-links {
padding: 10px 0;
}
.author-box .author-social-links span {
font-weight: bold;
@frankschrijvers
frankschrijvers / functions.php
Last active May 24, 2016 12:02
Add font awesome to genesis theme
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Required Fonts
add_action( 'wp_enqueue_scripts', 'wps_load_font_awesome' );
function wps_load_font_awesome() {
wp_enqueue_style( 'fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css', array(), '4.6.1' );
}
@frankschrijvers
frankschrijvers / functions.php
Last active April 21, 2016 11:21
How to create a custom author box in genesis
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Removes default Genesis Author Box, Adds a custom Author Box
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
add_action( 'genesis_after_entry', 'wps_theme_author_box', 8 );
function wps_theme_author_box() {
if ( is_singular('post') ) {
$author_avatar = get_avatar( get_the_author_meta( 'ID' ), 70 );
@frankschrijvers
frankschrijvers / functions.php
Created April 13, 2016 12:37
Redirect homepage on mobile
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Redirect homepage on mobile
add_action( 'wp_head', 'wps_params', 10 );
function wps_params() {
?>
<script>
if (window.location.pathname == '/' && jQuery(window).width() <= 480) {
@frankschrijvers
frankschrijvers / text.txt
Created March 7, 2016 10:52
shortcode genesis testimonial slider
[gts-slider]
@frankschrijvers
frankschrijvers / functions.php
Created March 2, 2016 15:12
How to hide trailing zeros on prices in WooCommerce
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Hide trailing zeros on prices.
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 );
function wc_hide_trailing_zeros( $trim ) {
return true;
}
@frankschrijvers
frankschrijvers / functions.php
Last active March 2, 2016 15:13
How to show trailing zeros on prices in WooCommerce
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
// Show trailing zeros on prices.
add_filter( 'woocommerce_price_trim_zeros', 'wc_hide_trailing_zeros', 10, 1 );
function wc_hide_trailing_zeros( $trim ) {
return false;
}
@frankschrijvers
frankschrijvers / functions.php
Created February 27, 2016 11:34
Allow the use of shortcodes in widget areas
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Allow the use of shortcodes in widget areas
add_filter('widget_text', 'do_shortcode');
@frankschrijvers
frankschrijvers / text.txt
Last active February 9, 2016 21:23
Short code modal box
[wps_login]Put your text here[/wps_login]
@frankschrijvers
frankschrijvers / functions.php
Last active February 9, 2016 13:53
Display the WooCommerce sidebar
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Display the WooCommerce sidebar
function wpstudio_woo_sidebar() {
if ( ! dynamic_sidebar( 'woo_primary_sidebar' ) && current_user_can( 'edit_theme_options' ) ) {
genesis_default_widget_area_content( __( 'WooCommerce Primary Sidebar', 'genesis' ) );
}
}