Skip to content

Instantly share code, notes, and snippets.

@ajmorris
ajmorris / login.php
Created January 12, 2012 20:34
WordPress Login with Your Email Address
<?php
function login_with_email_address($username) {
$user = get_user_by_email($username);
if(!empty($user->user_login))
$username = $user->user_login;
return $username;
}
add_action('wp_authenticate','login_with_email_address');
<?php
add_action('headway_setup_child_theme', 'disable_design_editor');
function disable_design_editor() {
remove_theme_support('headway-design-editor');
}
@test = "https://api.twitter.com/1/users/show.json?screen_name=TwitterAPI&include_entities=true"
@ip = "173.236.160.229"
c = Curl::Easy.new(url) do |curl|
curl.url = @test
curl.interface = @ip
end
data = c.perform
@result = JSON.parse(data.body_str)
@ajmorris
ajmorris / fire-style.css
Created January 26, 2012 00:21
Sample style.css for a Fire child theme for Headway Base
/*
Theme Name: Headway Fire Child Theme
Theme URI: http://headwaythemes.com
Description: A fiery take on a powerful element. This child theme features gradients and rounded corners in all the right places. It also contains separate widget styles, text shadows and a subtle black background.
Version: 0.1
Author: Headway Themes
Author URI: http://headwaythemes.com
Template: headway
*/
@ajmorris
ajmorris / functions.php
Created January 26, 2012 00:23
Sample Functions.php file
<?php
add_action('headway_setup_child_theme', 'hfct_remove_theme_support');
function hfct_remove_theme_support() {
// Removes the Design Editor from the Visual Editor
remove_theme_support('headway-design-editor');
// Removes Headway's basic CSS file
remove_theme_support('headway-structure-css');
// Removes Headway's Grid
@ajmorris
ajmorris / gist:1759756
Created February 7, 2012 13:47
headway css
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;vertical-align:baseline;}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block;}body{line-height:1;margin:0;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}table{border-collapse:collapse;border-spacing:0;}a{outline:none;}img{outline:none;}.clearfix:before,.clearfix:after{content:"";display:table;}.clearfix:after{clear:both;}.clearfix{zoom:1}div.wrapper{margin:0 auto}div.grid-container{height:auto;margin:0}div#whitewrap{width:100%;float:left}.clear{cle
@ajmorris
ajmorris / gist:1893747
Created February 23, 2012 16:59
Sample code for functions file
<?php
// This contains everything below the post. Has Social Sharing, Affiliate box, and Author Bio
add_action('headway_after_entry_content', 'aj_bio_share');
function aj_bio_share() {
if(is_single()) { ?>
<div class="post-ending"></div>
@ajmorris
ajmorris / gist:1918757
Created February 26, 2012 20:09
Sample Open Graph code
<?php
add_filter('language_attributes', 'add_opengraph_doctype');
function add_opengraph_doctype( $output ) {
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
}
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('headway');
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
@ajmorris
ajmorris / sample-functions.php
Created March 15, 2012 07:24
Adding content to the navigation
<?php
add_action('headway_block_close_4', 'add_twitter_to_navigation');
function add_twitter_to_navigation() {
echo '<li>twitter button code goes here</li>';
}