Posts Tagged Wordpress

Having an image logo AND logotype in Arclite (WordPress)

Arclite is still by far my favourite theme available on WordPress. At some point in time I wanted to have both my snazzy Sigma/E logo up along with the logotype “Ed’s Big Plans”. Arclite doesn’t allow this (at least there is no such setting in this version), so after some more digging in header.php, I found this chunk of code.

<?php
  // logo image?
  if(get_option('arclite_logo')=='yes' && get_option('arclite_logoimage')) { ?>
  <h1><a href="<?php bloginfo('url'); ?>/">
    <img
      src="<?php print get_option('arclite_logoimage'); ?>"
      title="<?php bloginfo('name');  ?>"
      alt="<?php bloginfo('name');  ?>" /></a></h1>
<?php } ?>

The above is code that checks if the user has selected to use an image logo– when this logo is available, Arclite displays the image and moves on down the page. Alternatively…

<?php else { ?>
  <h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
<?php } ?>

…when the user has selected not to use an image, Arclite handily prints out logotype.

Since I want Arclite to render both the image logo and logotype when they’re available, I’ve simply slapped the logotype printing in with the former snippet of code to make this…

<?php
  // logo image?
  if(get_option('arclite_logo')=='yes' && get_option('arclite_logoimage')) { ?>
  <h1><a href="<?php bloginfo('url'); ?>/">
    <img
      src="<?php print get_option('arclite_logoimage'); ?>"
      title="<?php bloginfo('name');  ?>"
      alt="<?php bloginfo('name');  ?>"
      style="vertical-align:text-bottom;" />
    <?php bloginfo('name'); ?>
  </a></h1>
<?php }

Quick and painless :D

Some inline CSS was used to get the logo and the text to sit inline with one another; by default, the logo goes out of line up high and the text goes down low.

Note that when one chooses not to use an image logo in Arclite’s settings, it just goes back to the default logotype behaviour– exactly as you’d expect.

Tags: ,

New Favicon :D

Brief: I’ve added a favicon to this blog. I’m unsure of whether or not modern versions of IE support specifying favicons the XHTML header way, so I’ll have to check it out some time. All browsers however allow the URL squatting method (which should have gone away before 2000 really). The latter doesn’t allow one to specify icons on a per page basis, rather the entire domain ends up with the same icon.

For any webpage, just add code similar to the below to specify a favicon…

<link rel="icon" type="image/png" href="/edfavicon.png" />

For WordPress, I’ve inserted that line into header.php inside the head tag.

Tags: ,

Wordpress Inline Comments

Thanks to flisterz for this tip!

I added inline comments to this blog– it actually involves editing index.php, something I generally avoided doing. Peering into the code, it’s as normal as any other PHP so all of those silly worries were washed aside. The Wordpress Codex does an excellent job of — well, it’s an incomplete API reference so it at the very least lists the functions that exist if it doesn’t truly explain them all.

Anyway– I didn’t just copy the hint from flisterz one to one because I wanted different functionality– but it did offer an example that let me make my changes much more easily. Because I don’t get very many comments, I don’t mind having complete comments show up inline on the main page instead of just an excerpt. As well, I wanted to have nice title bars to separate out the comments too… finally, while I was mucking around in the code, I decided to move the post tags up right beneath the title of each post instead of at the very bottom.

Changes made are inside index.php located before <?php end_while() ?>, just as in flisterz’s tip– here’s my version.

<div class="recent-comment">
<?php $comment_array = get_approved_comments($wp_query->post->ID); ?>
<?php if ($comment_array) {  ?>
    <?php foreach($comment_array as $comment){ ?>
    <br />
        <div style="background-color: #DDD9C6; border: 1px #F2EFE5 solid;">
        <em><?php comment_author_link(); ?> says...</em>
        </div><div>
        <?php comment_text(); ?>
        </div>
    <?php } ?>
<?php } ?>
</div>

In future, I’ll probably want to clean up the markup a bit by moving the style changes to this theme’s CSS. Oh, while I’m at it, I should also thank Digital Nature for this awesome theme (Arclite).

Tags: ,

Yay! Domain Move Done!

Brief: It changed from being something remarkably daunting to being something remarkably easy– two lines were added to wp-config.php as follows:

/////20091012 - CHANGED for DOMAIN MOVE.
define('WP_SITEURL', 'http://eddiema.ca');
define('WP_HOME', 'http://eddiema.ca');
/////

– After that, the apache ‘.conf’ file got an update so that both tin.blogdns.com and eddiema.ca pointed to the same doc root.

As far as I understand, this means that legacy posts (although branded with the previous subdomain in the mySQL table) can be served up under my new domain name, while new posts will be written to the table using the new branding. This is the behaviour I was hoping for! No need to update legacy entries, and full forward compatibility.

– Great! The wiki and my ticketing system are still working!

Tags: ,