Skip to content

Instantly share code, notes, and snippets.

@gstricklind
gstricklind / _content-page.php
Last active August 29, 2015 14:02
WordPress: Hide "Home" page title when front-page is set.
<?php if( !is_front_page() ):?>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php endif; ?>
@gstricklind
gstricklind / _functions-excerpts.php
Last active August 29, 2015 14:02
WordPress: Add number of post excerpts via shortcode
<?php
/**
* Excerpts Shortcode
*/
//[excerpts display="3"]
function kedc_shortcode_excerpts($atts) {
extract( shortcode_atts( array(
'display' => ''
), $atts) );
@gstricklind
gstricklind / _functions-widget_sitemap.php
Last active August 29, 2015 14:02
WordPress: Widget - mini sitemap. Allows for menus to be set and with the option to display these in one column or two column. Ideal for theme widget areas that don't need to be too small so the user can use the area for something else later if needed.
<?php
/**
* Create advanced widget for mini sitemap
*/
class kedc_mini_sitemap extends WP_Widget {
/*constructor*/
public function __construct() {
parent::WP_Widget(false, $name = 'Mini Sitemap');
}
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
global $wp_styles;
// Load the main stylesheet
wp_enqueue_style( 'my-theme', get_stylesheet_uri() );
@gstricklind
gstricklind / style.css
Last active November 12, 2015 05:46
Simple Social Icons: Colored Icons
/* Simple Social Icons
--------------------------------------------- */
.simple-social-icons li.social-dribbble a {
background-color: #049fb3 !important;
}
.simple-social-icons li.social-email a {
background-color: #049fb3 !important;
}
<?php
function dimox_breadcrumbs() {
/* === OPTIONS === */
$text['home'] = 'Home'; // text for the 'Home' link
$text['category'] = 'Archive by Category "%s"'; // text for a category page
$text['search'] = 'Search Results for "%s" Query'; // text for a search results page
$text['tag'] = 'Posts Tagged "%s"'; // text for a tag page
$text['author'] = 'Articles Posted by %s'; // text for an author page
@gstricklind
gstricklind / functions.php
Created February 16, 2016 17:10
Code snippets from Genesis Framework presentation at WP meetup
<?
/*========================================================================
Custom CTA
========================================================================*/
// Show CTA above footer widgets
add_action('genesis_before_footer','moons_custom_cta_1', 1);
function moons_custom_cta_1() {
echo '<div class="cta"><div class="wrap">This is the call to action.</div></div>';
/*========================================================================
Tag Cloud Filter
========================================================================*/
add_filter('widget_tag_cloud_args', 'filter_tag_cloud_limit');
function filter_tag_cloud_limit($args){
$args['number'] = ''; // Removes limit on number of tags
return $args;
@gstricklind
gstricklind / style.css
Created October 5, 2016 02:05
CSS Long Shadow with Alpha Transparency
.long-shadow {
text-shadow: rgba(18, 128, 106,1) -1px 1px,
rgba(18, 128, 106,0.99) -2px 2px,
rgba(18, 128, 106,0.98) -3px 3px,
rgba(18, 128, 106,0.97) -4px 4px,
rgba(18, 128, 106,0.96) -5px 5px,
rgba(18, 128, 106,0.95) -6px 6px,
rgba(18, 128, 106,0.94) -7px 7px,
rgba(18, 128, 106,0.93) -8px 8px,
rgba(18, 128, 106,0.92) -9px 9px,
@gstricklind
gstricklind / style.css
Created July 14, 2017 18:57
Change Beaver Build Icon style +remove icon background
/* change social icons */
.fl-social-icons .fa-stack i:first-child {
display: none;
}
.fl-social-icons .fa-stack i:nth-child(2) {
color: inherit;
}