all hail the latest meme to capture the hearts of the internet: grumpy cat:
so here’s my little sketch:
all hail the latest meme to capture the hearts of the internet: grumpy cat:
so here’s my little sketch:
so i’m heavily listening to these two songs by chiddy bang. xaphoon jones you crazy, crazy crazzeee
that’s the jam!
so i built a random name generator for andy’s site… it’s meant to show a name for one week, when that week is over, a new name will appear.
it’s super manual — every year, he has to run a script that will randomly generate the list for the year
now that i know a little bit more php, i’m wondering if there’s a way to have it randomly choose a name from a database and display that for one week. the “one week” part is the toughest.
surprisingly, i’ve already set up a plugin where he’ll be able to add, remove, edit names easily via the wordpress admin. all the names are in a nice database.
now to display a randomly generated name for a given week… halp?!
originally found this on josh stauffer’s site. just wanna add to my site so i can pull it up easily
$slug = basename(get_permalink());
needed to do this to make wordpress choose the thumbnail image instead of the full-sized image — since some people like to upload gernormous images (recall that wordpress uploads a whole set of images when you upload one)
so this adds a suffix (in this case, “-150×150”) to the of the filename, BUT before the file extension
anyway, here it is:
// set your suffix $thumbnail_suffix = "-150x150"; // $featured_image is the filename. this would be determined above this code snippet // determine the length of the filename, including the extension $length = strlen ($featured_image); // get the first part of the filename (before the extension) $temp1 = substr ($featured_image, 0, $length-4); // get the second part of the filename (the extension) $temp2 = substr ($featured_image, $length-4, $length); // stick the suffix in between the two halves $featured_image_updated = $temp1.$thumbnail_suffix.$temp2;
you might be saying, “but joey.. why don’t you just use something like explode to break up the filename?” well you really don’t know what the filename will be — it could have a bunch of dots in it… if you could figure it out, great. let me know what you did.
at least you know every image file that’ll be uploaded will be a “.” and then three characters after.
we celebrated mom’s retirement at tom ham’s lighthouse on sunday… it was a hot day and i couldn’t eat the crab legs, but it was still a good time.
congrats mom. we’re proud of you
note: took a bunch of pics, broke them into parts (click through the pages at the bottom of post)
tried this out the other day… dennis’ recipe — i’d marinate the meat — preferably flap meat — overnight
the gang got together to celebrate chaunce’s birthday at the local habit. good food, great beer, excellent people. i just love seeing friends talking and laughing around a table.
oh and the cake was ridiculously good… kicks costco’s carrot cake’s ass…
was challenged at work and couldn’t think of a proper solution. i knew it was possible, but didn’t know how to execute it
this is what happens when you don’t know all the tools you have available to you…
thank god for the wordpress community
this makes absolutely no sense without any background! essentially i have a splash page that goes to several sub-sites. when you get to a sub-site, i want each sub-site’s home to go back to its own home location, not the splash page, which would be
< ?php echo get_option('home'); ?>
< ?php //parent variables $parent = get_post($post->post_parent); $parent_title = get_the_title($parent); $grandparent = $parent->post_parent; $grandparent_title = get_the_title($grandparent);?> < ?php // is the homepage the granparent? if ($grandparent == is_page('0')) { ?> <li><a href="/<?php echo get_permalink($grandparent); ?>">Back to < ?php echo $grandparent_title; ?></a></li> <li><a href="<?php echo get_permalink($post->post_parent); ?>">Back to < ?php echo $parent_title; ?></a></li> < ?php // is the homepage the parent? } elseif ($post->post_parent ==is_page('0')) {?> <li> <a href="<?php echo get_permalink($post->post_parent) ?>">Back to < ?php echo $parent_title; ?></a></li> < ?php // I must be a top level page! } else { ?> <!-- no parent to show --> < ?php }?>