Just wanted to say that Snap569 Coding has moved to http://random-is.me/code.
Just wanted to say that Snap569 Coding has moved to http://random-is.me/code.
Tomorrow I’m off to Cairo, until the 23rd. Until then, see ya later!
Ahe ahem.. This is simply to express my hate towards this day. If you don’t wanna read it and enjoy the false day known as Valentine’s Day, and be arrogant then go ahead. If you’re cool, continue reading.
Valentine’s Day sucks! It’s full of bullshit. It’s too cheesy and pink. (Don’t worry, it gets better); but if you really love those around you, wouldn’t you show them how much you appreciate them and love them everyday? An occasion is a time marked by a certain event. NOT a day where you decide to love people and act all kind and make them feel special, and then the next day everything’s back to normal.
That’s the small rant, sorry if I killed your Valentine’s Day spirit.
PS: Don’t kill me — it’s called ‘Freedom of Speech’. Oh, and feel free to spread this.
I’ve got a few people asking about how I got the seconds it took the page to load to display. Just wanna share the code:
1 | <?php timer_stop(1); ?> <?php echo $db->num_queries; ?> |
Or you can simply use:
1 | <?php echo('text before time' . timer_stop(0) . 'text after time'); ?> |
HTML is allowed in text before time and text after time.
Works in a WordPress environment only.
Search Engine Optimization (SEO), is well self-explanatory. I shouldn’t have to explain what it is, but I will! SEO is simply moving up in the search engine rankings. Hopefully search engines will like you more after you make use of this post. On with my tips:
By headers I mean <h1>, <h2>, <h3>, <h4> and so on. What you should have is 1 <h1> tag, 10-15 <h2>, and as many as headers your sidebar needs for <h3>. Confused? I’ll explain. <h1> tags should have the website’s/webpage’s title (eg. Random-is.me). <h2> tags should have the description (if any) (eg. It’s random, too damn random) and the post titles. <h3> tags should be used for sidebar titles.
Make sure you have a description, keywords, author etc. If you don’t have them, Google meta generator.
Sadly they don’t. So use alt="image of something" for images and title="image of something" for images, links, titles, headers etc.
No I’m not kidding, search engines prefer it.
Got your own tips to share? Go ahead.
Well as you may have seen, I’ve been changing themes quite frequently in the last few days. I decided to go back to Resurrection (my theme), and as I was looking through the comments code, I found this:
1 | <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out »</a></p> |
What’s wrong with that you ask? If you’re on WordPress 2.7 (you better be), you’re gonna have a problem. In WordPress 2.7, you’ll notice there’s a wpnonce=x (x being random figures and letters) added to the logout URL. How do I get that when there’s a random figure there? Simple:
1 | <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(); ?>" title="Log out of this account">Log out »</a></p> |
See the difference? It’s the echo wp_logout_url();. That function gives you the whole URL with the wpnounce.
Just upgraded – WordPress 2.7.1!