Adding Social Twitter

I haven’t implemented this here on the blog, however I am definitely considering doing so.  Do you want to make sharing of your blog articles on Twitter easier than ever?

The easiest option is to add a Twitter button on each post.  The following code does just that, and the button will only appear on a single post, and not blog, archive, or search pages.

add_action( 'the_content' , 'itsb_tweet_button' );
function itsb_tweet_button( $content ) {
if ( is_single() )
return '<div class="twitter-button"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'. get_permalink() .'" data-count="vertical" data-via="oursexsecrets">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>' . $content;
return $content;
}
view raw functions.php This Gist brought to you by GitHub.

The code adds a div before the main content that you can style as you want.  You can float it to the left or the right, and position as you want.

You can also customise the output of the function, and move the twitter button to the end of the content.  Or add other social media buttons as well, tweaking the output and position the way you like it.

Using LessCSS

I’ve been experimenting with a number of CSS methods to try and make WordPress theme development more friendly for both myself, and for others who may want to tweak the theme when I have released it into the wild internet.

One particlar method I have been using is LessCSS.

I use the following code to add the less.js file, as well as linking to a .less file.

function itsb_lesscss() {
?><link rel="stylesheet/less" type="text/css" href="<?php echo get_template_directory_uri(); ?>/style.less">
<script src="<?php echo get_template_directory_uri(); ?>/js/less.js" type="text/javascript"></script><?php // Download the less.js file from http://lesscss.org/
}
add_action( 'wp_head' , 'itsb_lesscss' );
view raw functions.php This Gist brought to you by GitHub.

You can adjust the locations of the files to suit your file structure for your theme, but this will add the necessary code.

Private Git Repository?

Again I’m not happy with my blog theme design, and thinking about a design update for the blog, hopefully to something that reflects me.

But as I’m designing the theme, I want to keep it private until I have a 95% ready issue.  So how would you go about working it?  I’m thinking of using Github as I have a number of other themes over there, but at the same time, I would rather a private repository to store the files until I am ready to release it publically.

So who would you use?  Github and pay to have a private repo?  Or an alternative provider that gives private repos for free accounts?  I’m thinking the latter because I’m not really a fully-fledged designer to warrant paying, but going with a hosted repo with a reputation seems like a good thing to go with.

What are your thoughts?

Moved to Git

Since I’m looking at some theme design these holidays, I’ve decided to move my code to a hosted repository such as Git for version control and storage.

I have also updated the Minimalism Theme I created, and moved that to Github, where you can easily download the latest theme code.

If you would like to share your design processes, as well as workflows with Github, I’d love to hear from you.

Minimalism Theme

I have never really written a theme release page before, so please go easy on my for now.

I am a WordPress designer that isn’t really ever happy with any of the themes that I create for my blog here. I always find that the theme is missing something, but I can never quite put my finger on it to rectify the situation. For now, I have settled on a theme that I designed called Minimalism.

Minimalism is built as a child theme using the Genesis Framework.

I have tried to minimise the use of images, and reduced the CSS file down to as small as required to ensure a quick, and easy download. I may consider adding Post Format images for a Tumblr style blog for those that are interested, but that won’t be until a future release.

Download:Minimalism Theme (Github Download)