Design, Programming

Add Disqus comments to WordPress and edit CSS

For those of you who have struggled using the Disqus WP Plugin, this guide is for you. I tried using the plugin, but no matter which stylesheets I edited, I couldn't edit the Disqus CSS since the stylesheets are located within an iframe tag. Anyways here's what I did to fix that annoying box/margin error.

Using this guide, I added this JavaScript code to the end of my functions.php file.

function disqus_embed($disqus_shortname) {
    global $post;
    wp_enqueue_script('disqus_embed','http://'.$disqus_shortname.'.disqus.com/embed.js');
    echo '<div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = "'.$disqus_shortname.'";
        var disqus_title = "'.$post->post_title.'";
        var disqus_url = "'.get_permalink($post->ID).'";
        var disqus_identifier = "'.$disqus_shortname.'-'.$post->ID.'";
    </script>';
}

Next, I replaced comments_template(); in my single.php and page.php files with this code:

//comments_template();
echo '<div class="disqus-div">';
disqus_embed('YY');
echo '</div>';

Replace YY with your Disqus short name (typically http://shortname.disqus.com). Finally, I added this CSS to my custom.css file. Replace XX with the margins of your liking.

.disqus-div {
  margin-top: XXpx;
  margin-right: XXpx;
  margin-left: XXpx;
}

You can also add any other CSS you want to this class. Cheers, hope this helps someone.

Standard
Design, DIY

Screw the MacBook Air

I don't know when I actually decided I wanted an Apple computer; I've been using Windows, Ubuntu, and Hackintosh computers for all my life.  I still distinctly recall using MS-DOS to switch to my floppy drive directory in order to play my computer games.

I guess the design of the MacBook Air captivated my technological hormones: 0.68" in height, 2.96 lbs, and 7 hours of battery life -- what's not to love.  After some preliminary research, the 13" MacBook Air runs for about $1500 for the options I want.  Even with the rumored retina screen (which would increase the price by another 200), I still don't think a piece of technology should be priced so damn high.  Call me old fashioned, but I'm still a firm believer in Microsoft products for productivity.

So check it out:  I rigged my Asus U30JC-A1 with some supercharged upgrades.  Although the specifications say that my laptop only supports 4GB RAM, the Intel i3 technology actually supports up to 8GB RAM.  Furthermore, I swapped out the ancient DVD Drive, which also duals as a paper weight, with an SSD caddy and a brand new Samsung 840 SSD.  Whoa, nerdgasm.

I doubt my Asus is running the SSD at SATA3 transfer rates, but damn this thing is fast.  It definitely feels like my computer is running at double the horsepower, but I only spent $200 for all the upgrades.  Here's hoping this laptop will run me through the end of college.

On a side note, I changed up a bit of the Ryu theme.  I really wasn't digging the widget buttons at the top, so I scattered those menus among my page.  I've yet to make all of the CSS updates I want, but this is a good start.. WordPress, success!

Standard
Design, Programming

Switched from Rails to WordPress for CMS

I was screwing around with the Refinery gem for the first half of today, and I kept wondering why everything seemed so outdated -- why the hell is it so ugly??  The last blogging gem available for Rails, Mephisto, was updated 4 years ago...  Needless to say, I didn't want to craft my own content management system or use any of the gem alternatives for my blog application.

So here I am, and I must say WordPress is light years ahead of its competition (I'm looking at you Joomla).  I love the ability to quick install plugins and customize all of the content of the fly.  The flexibility of this CMS reminds me a bit of Drupal, but much more intuitive.  Moreover, I've finally found a use for the GoDaddy Linux server that I regretfully paid for a year's worth of hosting, but more on that later.

The only gripe I have against WordPress -- and it's not even the company's fault -- is how many people have used the default themes!!  Just browsing the first few pages of themes, I realize that multitudes of websites haven't even touched the CSS.  Rather, they apply the default theme and hope that no one else uses the same theme...

For now, I'm going to see how enjoyable this WordPress system can be. Stay tuned for design updates!!

Standard