I ran into this nice Excel Plugin that lets you import web analytics data from Google Analytics into a spreadsheet. It’s an open source project and 100% free to download and use for individuals and businesses.
WordPress – List Scheduled Posts
If you ever wanted to show you readers posts that are scheduled to be published, here’s how to do it.
<?php
$result = new WP_Query('post_status=future&order=DESC&showposts=5');
if ($result->have_posts()) {
while ($result->have_posts()) : $result->the_post(); ?>
<?php the_title(); ?>
<?php endwhile;
}
?>
CSS – Cross Browser Opacity
A little hack to set Cross-Browser opacity.
.setOpacity {
opacity: .75; /* Standard: FF gt 1.5, Opera, Safari */
filter: alpha(opacity=75); /* IE lt 8 */
-ms-filter: "alpha(opacity=75)"; /* IE 8 */
-khtml-opacity: .75; /* Safari 1.x */
-moz-opacity: .75; /* FF lt 1.5, Netscape */
}
WordPress – Disable Auto Save
WordPress’s Auto-Save feature is a really nice but there are some drawbacks… this feature increases your database usage. So for those of you that are on really bad shared hosting accounts or just want to turn it off, here’s a quick way of doing it.
Open and insert the following line in your wp-config.php file.
define('WP_POST_REVISIONS', false);
Another method is to remove all of the entries from the database from time to time. You can do tun this query to do it::
DELETE FROM wp_posts WHERE post_type = "revision";
Prototype JS – Determine if an object exists in the page loaded
I’m so use to using jQuery that I usually don’t have to look up documentation on how to use certain functions. They almost come naturally because it’s so English-like! Unfortunately Magento uses Prototype as it’s native choice of Javascript Frameworks. I sure wish they would have chosen jQuery! I think they would have more people jumping on their platform. I’m sure they have a good choice for it. Anyway, here’s how to check:
if($('id_of_element') != undefined) {
alert('Object exists.');
}
Magento – Check if a User is logged in
You may want to check if a user is logged in with Magento, possibly to display a link or promotional item. Here’s how to do it:
<?php
if ($this->helper('customer')->isLoggedIn()) {
echo("Anonymous user");
}
else {
echo("Authenticated user");
}
?>
Magento – How to Display the Product SKU
Sometime you may need to display the product Sku on the category page. This is easily achieved:
<?php echo($_product->getSku()); ?>
-
Beware the heat-seeking Nerf machine-gun coming to a cubicle near you http://om.ly/svHF #fb
- Follow me
Last Tweet
-
Archives
Categories
My Favorites
- 37 Signals
- Andrew Warner
- Chris Coyier
- Chris Shiflett
- Collis Ta'eed
- Development Seed
- Drupal
- HubSpot
- James Padolsey
- Joel On Software
- John Resig
- jQuery
- Kevin Rose
- Life Hacker
- Magento
- Mashable
- Matt Cutts
- Matt Ryan
- MySQL
- NetTuts
- Noupe
- Photoshop Tutorials
- PHP
- Smashing Magazine
- Tech Crunch
- WoorkUp
- Wordpress
