Ed's Big Plans

Science, Technology, Adventure

Archive for the ‘Wordpress’ tag

The Journalist: A Minimalist’s WordPress Theme

without comments

Brief: I’ve switched to “The Journalist” by Lucian E. Marin to combat the nagging page weight of more decorative WordPress themes. This should make loading my page far quicker. Ideally, I’d like to have it load as quickly as SnOwy, my wiki notebook. When I get some spare time, I’ll add my logo to the title region of this page– don’t worry (he says to himself), I’ll optimize the file size for that as well.

Update: I’ve made the modifications I always do — Inline comments now appear on both the main and archive-like pages, and search results are trimmed as excerpts.

Inline comments

Added the following div after the the div class=”main” and before the div class=”meta group” — changes made to index.php and archive.php.

<div class="recent-comment">
<?php $comment_array = get_approved_comments($wp_query->post->ID); ?>
<?php if ($comment_array) {  ?>
    <?php foreach($comment_array as $comment){ ?>
        <div style="background-color: #f6f6f6; border-top: 1px #bbb solid;">
        <strong><?php comment_author_link(); ?> says...</strong>
        </div><div style="padding: 10px 0px 10px 0px;">
        <?php comment_text(); ?>
        </div>
    <?php } ?>
<?php } ?>
</div>

Excerpts in search results

Changed a call to “the_content()” to a call to “the_excerpt()” — changes made to search.php.

Written by Eddie Ma

April 23rd, 2010 at 11:25 am

Posted in Technology

Tagged with

Arclite Theme – Invisible Text in Submenu Fix

without comments

Brief: The Arclite WordPress Theme is great, but the default CSS for the submenu causes the text to be almost completely invisible when moused over. The fix is an easy edit in style.css.

ul#nav ul a:hover, ul#nav ul a:hover span,
ul#nav a.active ul a:hover span,
ul#nav li.current_page_item ul a:hover span,
ul#nav li.current_page_ancestor ul a:hover span,
ul#nav ul li.current_page_parent a:hover span,
ul#nav ul li.current_page_item a:hover span,
ul#nav ul li.current_page_parent li.current_page_item a:hover span{
  //color: #fff;
  color: #2d83d5;
  background: #CCCCFF;
}

To make the text look like a deep blue on light blue, I changed the default white colour for a:hover in the sub-menus section to match the text colour of the blue in the rest of the theme plus a lighter blue as its background.

Written by Eddie Ma

March 5th, 2010 at 7:51 pm

Posted in Technology

Tagged with , , ,

Logo and Title with Arclite Theme v2.02

without comments

This is an update to this post.

It’s even easier in this version of Arclite 2.02 to throw up both a logo and title.

Edit header.php as follows…

Before:

<?php
      // logo image?
      $logo = (get_arclite_option('logo'));
if($logo): ?>
      <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><img src="<?php echo $logo; ?>
      "title="<?php bloginfo('name');  ?>" alt="<?php bloginfo('name');  ?>" /></a></h1>
<?php else: ?>
      <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
<?php endif;  ?>

After:

<?php
      // logo image?
      $logo = (get_arclite_option('logo'));
if($logo): ?>
      <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><img src="<?php echo $logo; ?>"
      title="<?php bloginfo('name');  ?>" alt="<?php bloginfo('name');  ?>"
      style="vertical-align:text-bottom;" /><?php bloginfo('name'); ?></a></h1>
<?php else: ?>
      <h1 class="logo"><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
<?php endif;  ?>

That’s it!

  • style="vertical-align:text-bottom;"
    • This chunk is used to keep the logo in line with the title text as last time.
  • <?php bloginfo('name'); ?>
    • This chunk produces the title text.

Written by Eddie Ma

February 15th, 2010 at 1:48 pm

Posted in Technology

Tagged with ,

Having an image logo AND logotype in Arclite (WordPress)

without comments

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.

Written by Eddie Ma

December 22nd, 2009 at 3:03 pm

Posted in Technology

Tagged with ,

New Favicon :D

without comments

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.

Written by Eddie Ma

December 22nd, 2009 at 11:14 am

Posted in Technology

Tagged with ,

WordPress Inline Comments

without 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).

Written by Eddie Ma

November 24th, 2009 at 12:29 pm

Posted in Technology

Tagged with ,

Yay! Domain Move Done!

without comments

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!

Written by Eddie Ma

October 12th, 2009 at 12:47 pm

Posted in Technology

Tagged with ,