Skip to content

Instantly share code, notes, and snippets.

View frankschrijvers's full-sized avatar

WPStudio frankschrijvers

View GitHub Profile
@frankschrijvers
frankschrijvers / functions.php
Last active May 20, 2016 08:21
Set default images sizes WooCommerce
<?php
//* Do NOT include the opening PHP tag
add_action( 'after_switch_theme', 'wpstudio_woocommerce_image_dimensions', 1 );
function wpstudio_woocommerce_image_dimensions() {
global $pagenow;
if ( ! isset( $_GET['activated'] ) || $pagenow != 'themes.php' ) {
return;
}
@frankschrijvers
frankschrijvers / widget.html
Created November 6, 2015 11:25
Accessibility support
<span class="fa fa-tree"></span><span class="screen-reader-text">Nature</span>
@frankschrijvers
frankschrijvers / functions.php
Last active May 24, 2016 12:24
Add Font Awesome
// Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
}
<i class="fa fa-tree"></i>
<h4>Nature</h4>
Nam pretium turpis et arcu. Pellentesque auctor neque nec urna. Sed consequat, leo eget bibendum..
@frankschrijvers
frankschrijvers / style.css
Last active November 5, 2015 09:30
Circular Background for Font Awesome Icons
.textwidget i {
background: none;
border: 3px solid #eee;
border-radius: 50%;
box-sizing: content-box;
color: #c7ad7b;
display: inline-block;
font-size: 3.42857rem;
height: 3.42857rem;
padding: 30px;
@frankschrijvers
frankschrijvers / style.css
Last active September 24, 2015 20:35
Genesis Simple Share alternative styling
/* Genesis Simple Share
--------------------------------------------- */
/* Centers the icons */
.share-before, .share-after {
overflow: auto;
text-align: center;
}
.sharrre {
// Deregister stylesheet Genesis Simple Share
add_action( 'wp_enqueue_scripts', 'wpstudio_deregister_styles' );
function wpstudio_deregister_styles() {
wp_deregister_style( 'genesis-simple-share-plugin-css' );
}
@frankschrijvers
frankschrijvers / functions.php
Last active August 29, 2015 14:27 — forked from GaryJones/functions.php
Style the Genesis comment count number
<?php
// Don't include above <?php
add_filter( 'genesis_post_comments_shortcode', 'prefix_post_comments_shortcode' );
/**
* Amend the post comments shortcode to add extra markup for styling.
*
* @author Gary Jones
* @link http://gamajo.com/style-comment-number/
@frankschrijvers
frankschrijvers / style.css
Created July 31, 2015 22:00
Basic styling WooCommerce search box Genesis navigation
.searchbox {
float: left;
}
.searchbox form {
width: 320px;
}
.searchbox form input {
padding: .8em
}
@frankschrijvers
frankschrijvers / functions.php
Last active February 24, 2016 01:01
Add WooCommerce Search Box to navigation Genesis
add_filter( 'wp_nav_menu_items', 'wpstudio_add_woo_search', 10, 2 );
/**
* Add WooCommerce cart to primary navigation Genesis
* @author Frank Schrijvers
* @link https://www.wpstud.io/add-woocommerce-cart-to-genesis-navigation/
*/
function wpstudio_add_woo_search( $menu, $args ) {