mrkeck Sharing the Love

29Nov/122

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
29Nov/120

Priority Inbox for Gmail

Set your Gmail so your most important emails are on top.
http://www.googlegooru.com/how-to-set-up-priority-inbox-in-gmail/

Filed under: web No Comments
28Nov/120

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

<?php
	if(is_front_page()){
		//echo "We are home";
		include ('home.php');
	}else{
		//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
27Nov/120

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!
http://www.bluesunray.com/wordpress-tips/how-to-increase-upload-max-file-size-for-dreamhost

Filed under: wordpress No Comments
26Nov/120

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.
Benchmark http://jsperf.com/rounding-numbers-down/15

Filed under: Optimization No Comments
26Nov/120

Javascript sleep function

var sleepyTime=10*1000;  //10 seconds
setTimeout(function(){
//In 10 seconds this will alert("I'm awake!");
alert("I'm awake!");
},sleepyTime);
26Nov/120

CSS Convention

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

body{
 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
26Nov/120

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>
</div>

I learned this from:
http://phrogz.net/CSS/vertical-align/index.html

Filed under: CSS No Comments
25Nov/120

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
12Nov/120

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