Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
/* Align Simple Social Icons Centered */
.simple-social-icons ul.alignright,
.simple-social-icon ul.alignleft {
text-align: center;
}
.simple-social-icons ul.alignright li,
.simple-social-icons ul.alignleft li {
display: inline-block;
float: none;
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:18 — forked from thomasgriffin/gist:4253190
How to Add Custom Classes to First and Last Items in WordPress Menu
<?php
add_filter( 'wp_nav_menu_objects', 'afn_custom_menu_class' );
/**
* Filters the first and last nav menu objects in your menus
* to add custom classes.
*
* @since 1.0.0
*
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:18 — forked from robneu/wordpress-font-awesome-cdn.php
Enqueue and Load Font Awesome icon font in WordPress
<?php
/**
* Enqueue and Load Font Awesome
*
* @author WPSpeak.com
*/
add_action( 'wp_enqueue_scripts', 'afn_enqueue_awesome' );
function afn_enqueue_awesome() {
@wpspeak
wpspeak / jetpack-twitter-via.php
Last active December 24, 2015 05:09 — forked from norcross/jetpack-twitter-via.php
Add Twitter handle to Jetpack Sharing module
<?php
//* Add Twitter handle to Jetpack Sharing module
add_filter ( 'jetpack_sharing_twitter_via', 'afn_add_twitterhandle_via' );
function afn_add_twitterhandle_via() {
return 'WPSpeak';
}
@wpspeak
wpspeak / custom-readmore-excerpt.php
Last active April 16, 2019 14:18 — forked from studiopress/custom-readmore-excerpt.php
Customize [...] in WordPress excerpts
<?php
//* Customize [...] in WordPress excerpts
add_filter( 'the_excerpt', 'sp_read_more_custom_excerpt' );
function sp_read_more_custom_excerpt( $text ) {
if ( strpos( $text, '[&hellip;]') ) {
$excerpt = str_replace( '[&hellip;]', '<p><a class="more-link" href="' . get_permalink() . '">Read More &rarr;</a></p><br>', $text );
} else {
$excerpt = $text . '<p><a class="more-link" href="' . get_permalink() . '">Read More &rarr;</a></p>';
}
<?php
add_action( 'pre_get_posts', 'mfsbig_remove_floating_social_bar', 15 );
/**
* Remove Floating Social Bar from outputting at the top of the content.
*
* FSB adds these filters at pre_get_posts, priorty 10, so we'll remove them
* just after that.
*
* @author Gary Jones
@wpspeak
wpspeak / functions.php
Last active December 21, 2015 16:59 — forked from christophercochran/Genesis Layout Logic
Conditionally force layout in Genesis Framework
<?php
/**
* Conditionally force layout in Genesis Framework
*/
function cc_layout_logic() {
/**
* Genesis layout helper functions.
* __genesis_return_content_sidebar
* __genesis_return_sidebar_content
<?php
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
* Register and load font awesome
* CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#tab_fontawesome
* @author FAT Media
*/
function prefix_enqueue_awesome() {
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:19 — forked from braddalton/Add Genesis Search Box To Primary Nav Menu.php
Add Genesis Search Box to Secondary Menu
<?php
// Add Genesis search form to secondary menu
add_filter( 'wp_nav_menu_items', 'genesis_search_secondary_nav_menu', 10, 2 );
function genesis_search_secondary_nav_menu( $menu, stdClass $args ){
if ( 'secondary' != $args->theme_location )
@wpspeak
wpspeak / annotated-style.css
Created June 19, 2013 07:24 — forked from GaryJones/annotated-style.css
Fix Genesis 2.0 CSS for Gist (Props Gary)
/* Same as other file, but with extra notes */
/* Embedded Gists */
.line-pre::before,
.line-pre::after,
.line::before,
.line::after {
content: ''; /* Fixes addition of float-clearing space added to before and after global pre and div elements */
}