Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Created September 25, 2014 14:24
Add support for custom background in WordPress theme
<?php
//* Add support for custom background
add_theme_support( 'custom-background' );
@wpspeak
wpspeak / functions.php
Last active November 12, 2015 22:07
Add Estimated Post Reading Time in Genesis Framework
<?php
//* Add Estimated Post Reading Time in Genesis Framework using Estimated Post Reading Time plugin
add_filter( 'genesis_post_info', 'afn_post_info_filter' );
function afn_post_info_filter($post_info) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit] Estimated reading time: [est_time]';
return $post_info;
}
@wpspeak
wpspeak / video-popup-button.html
Created September 11, 2014 15:35
Create a Button for Video Popup (for WP Video Lightbox plugin)
<a class="button" rel="wp-video-lightbox" href="https://www.youtube.com/watch?v=G7z74BvLWUg&amp;width=640&amp;height=480">Watch Video</a>
@wpspeak
wpspeak / style.css
Created September 11, 2014 15:33
Basic styling for button (Copied from Genesis Framework)
/* Button */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button {
background-color: #333;
border: none;
color: #fff;
@wpspeak
wpspeak / image.html
Created August 18, 2014 02:34
HTML to Add Image
/* Add an image linking to custom-link.com, centered and open in new tab */
<a href="http://custom-link.com" target="_blank"><img class="aligncenter size-full" src="http://domain.com/images.jpg" alt="your-keyword" /></a>
@wpspeak
wpspeak / twitter.html
Created August 17, 2014 20:48
Embed Twitter Tweet
<blockquote class="twitter-tweet"><p>Traffic for <a href="http://t.co/L62SuKvy" title="http://wpspeak.com">wpspeak.com</a> seems pretty good. Now have to start with SEO. This should be fun.</p>&mdash; WPSpeak (@WPSpeak) <a href="https://twitter.com/WPSpeak/status/300476649558917121">February 10, 2013</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
@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 / style.css
Created August 13, 2014 14:17
How to Display Avatar in Circular in WordPress
.avatar {
border-radius: 50%;
}
@wpspeak
wpspeak / style.css
Created August 9, 2014 17:02
Simple Gradient Background (Ellipse at the center)
.body {
background: radial-gradient(ellipse at center center , #fff8b5 0%, #f1e767 37%, #feb645 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
}
@wpspeak
wpspeak / functions.php
Last active August 29, 2015 14:04
Display Custom Post Types in Recent Posts Widget
<?php
//* Display Themes CPT in Recent Posts Widget
add_filter('widget_posts_args', 'afn_cpt_recent_posts_widget');
function afn_cpt_recent_posts_widget($params) {
$params['post_type'] = array('themes');
return $params;
}