Posts Tagged ‘php’

new home… feels roomy

so I FINALLY got my domain name and hosting transfered over to our gorirra account at hostgator… it’s something I’ve been meaning to do, I just knew it meant I had to create a new theme

so here it is… much like jurassic park, there are a few glitches here and there but all will be ironed out soon enough

I wanted a theme where I could easily showcase my favorite pictures I’ve taken with my brand new sony nex-3. I came up with this sorta hybrid of a photo gallery/blog…

I may write a post of the backend php stuff I wrote in order to get this to work out the way it does

I’m also happy that the site is responsive… err… will be responsive. if you view it thru your phone, you’ll see the gallery frame a little too tall and a few other things… the hulu embed also breaks the container a bit

I’ve been meaning to learn responsive web design and I plan to implement stuff to this site… should be fun

btw, all the old posts are still here.. gotta love wordpress for that… so go and look around at all my ellipses and lazy writing

* mind the spelling and typos… posting from my phone

wordpress php snippets

here are a bunch of frequently used code snippets i’ve used with many of my projects

* i really should know these by now… but what are ya gonna do?

linking to the homepage

    <a href="<?php echo get_option('home'); ?>">...</a>

    image references

      <img src="<?php bloginfo('stylesheet_directory'); ?>/images/FILE_NAME.jpg"
      alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" />

      dynamic widgets

        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('WIDGET_NAME') ) : ?>
        <?php endif; ?>

        then, in functions.php, add this:

        register_sidebar(array('name'=>'WIDGET_NAME',
        'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
        ));

        custom fields – mentioned before on my site, but just to have ‘em all together

          <?php $VARIABLE_NAME=get_post_meta($post->ID, "CUSTOM_FIELD_NAME", true);
          if (get_post_meta($post->ID, "CUSTOM_FIELD_NAME", true)) {
          echo ("<img src=\"FULL_PATH_TO/$VARIABLE_NAME\" />");
          } ?>

          copyright

            &copy; <?php echo date('Y'); ?> - <?php bloginfo('name'); ?>

            wordpress: creating your own custom theme

            hot on the heels of my first tutorial, i come back at ya with a new one.

            i REALLY like using wordpress as a cms — not only for its ease of customization or its extensive library of useful (mostly) plugins, but for these two huge reasons:

            1. ability for the end-user to modify the web site content without breaking the overall site geography
            2. search engine optimization — yea i kinda did mention them earlier, but several plugins can work to help your site get spidered like the best of them.

            so i guess that answers the “why use wordpress?” question — here’s my method of getting a custom theme setup for wordpress
            (more…)

            wordpress: change your home page to a custom page

            so chaunce asked if i could do a small tutorial for a wordpress (wp) question he had… i’m honored that he asked me to do so… actually, i think i might start to write a bunch of tutorials that i’ve learned along the way…

            and here… we… go…

            this tutorial deals with the user wanting a site with a blog and pages, but the user wants a specific page to be the front page, not the blog (something similar to andy’s site, but not — since he doesn’t want his site to be full-on wordpress)

            *note, i suck at technical writing, but i’ll try to fake it… i’m open to suggestions/comments for future tutorials
            (more…)