mrkeck Sharing the Love


WordPress Theme simpleCorp Slider Only Shows One Slide (Fixed)

simpleCorp slider was broken because it only showed one slide instead of all the ones in the list.
To fix change one line in /wp-content/themes/simplecorp/homepage-slider.php

//Take out
//$wp_query = new WP_Query('post_type=featured&orderby=menu_order&order=ASC&sliders='. $slider);
//Add next line
$wp_query = new WP_Query('posts_per_page=10&post_type=featured&orderby=menu_order&order=ASC&sliders='. $slider);
Filed under: wordpress 2 Comments

Priority Inbox for Gmail

Set your Gmail so your most important emails are on top.

Filed under: web No Comments

WordPress Theme Not Recognizing Static Front Page as Home Page

I created a page called "Home" and set it as my Static Front Page (make it my home page).
But the theme I am using simpleCorp doesn't recognize my static front page as being the home page.

So I changed the page.php in the theme folder (/wp-content/themes/theThemeYouAreUsing/) to see if the current page is set as the front page and if it is then use home.php instead. The code is easier than it may sound.
Just add

		//echo "We are home";
		include ('home.php');
		//echo "Nope";

Right below:

<?php get_header(); ?>

Then make sure you add:

<?php } ?>

Directly above:

<?php get_footer(); ?>

at the bottom of page.php.

That's it!

Filed under: wordpress No Comments

WordPress Maximum Upload Size on Dreamhost

I kept getting "Maximum upload file size: 7MB". I read abunch of articles about php.ini in wp-admin and ini_set but nothing worked except this article:
Sounded a little scary but was super easy and worked great!

Filed under: wordpress No Comments

Javascript: Faster Math.floor and parseInt

var str='123.55';
var num1=~~str; //num=123
var num2=Math.floor(str); //num=123
var num3=parseInt(str); //num=123

~~ operator gives the same result as Math.floor and parseInt but is slightly faster than Math.floor and is 6 times faster than parseInt.

Filed under: Optimization No Comments

Javascript sleep function

var sleepyTime=10*1000;  //10 seconds
//In 10 seconds this will alert("I'm awake!");
alert("I'm awake!");

CSS Convention

I've started using a new convention for my css:

 width: 500px; height: 500px;
 margin: 0px; padding: 0px;
 position: absolute;
 top: 0px; left: 0px;

Things that have pairs like (width and height) and (margin and padding) or things that work together, I put on the same line.

Filed under: Convention, CSS No Comments

Vertical Align Center CSS

Vertical Align Center CSS

<div style='height:8em;border: 1px solid #369;'>
<span style='line-height:8em;'>Vertical Align Center CSS</span>

I learned this from:

Filed under: CSS No Comments

Always show vertical scrollbar with CSS

html {overflow-y: scroll;}

I do this to make it so things don't jump if more things appear.

Filed under: CSS No Comments

Windows Anonymous is not included in Everyone

In some versions of Windows the "Anonymous" Group is not included in the "Everyone" Group.

Thought it was worth noting in case it comes up sometime. Like normal breakfast chit chat.

Filed under: windows No Comments