Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
<?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 / 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>';
}
@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 / 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 / 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
*
/* 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;