Matthew Engel

Science and Technology Advocate

Matthew Engel header image 4

Outputting HTML using PHP: Changing Font styles

November 9th, 2008 · No Comments

Today I spent at least one hour trying to fix some code on another site I am working on. It was such a pain to do, that I am writing the solution here so that others may learn from my struggles.

The problem was that I had a piece of php code outputing some nice html on the webpage, but I could not figure out how to edit the font of the html. Php uses the ‘echo’ command to output html, which is great and really simple. However, for the life of me I could not make the desired output in bold face, which was so frustrating. I was not sure if I would need to use css or not, but found finally found the quick and easy solution here.

Originally my code looked like:

echo category_description($catz);

Which I needed to change to:

echo "<B>".category_description($catz)."<?b>";

Notice the bold html tags <b> are in quotes. This was critical to get it to work, but not sufficient. The critical part was actualy putting the periods! So annoying. Anyway, notice the additional periods after the opening bold tag quotation marks and after the php command itself.

Tags: ·

Recent Theme Updates

September 28th, 2008 · No Comments

Theres a million things I could write about here, but I will keep it tight. Focused, here we go. Spit it - wordpress right here.  Just updated the theme, customized the header.php file. I am using the Cutline Theme v1.3 designed by J. Angelo Racoma. This is an amazing theme, but I don’t want you to use it, too, because our blogs will look the same. Here’s the skinny anyway, just in case you are using it already.

Here is a link to the Cutline theme homepage

One thing I did not figure out how to use was the archives page. But instead I substituted this with my own Travel page, which is nice. That page needs to be seriously updated to fit into this new theme. On his site, Racoma explains how to edit the header so you can customize the pages which are displayed right under your banner.

Specifically, here’s the code I had to edit in my header.php

<li><a <?php if (is_archive() || is_page(’archives’)) echo(’class=”current” ‘); ?>href=”<?php bloginfo(’url’); ?>/travel/”>Travel</a></li>

Notice I changed the ‘archives’ text to ‘travel’ between <a>text</a>

Another I had to do was update my permalink structure. He explains this really well, and I would highly recommend NOT using the default permalinks structure since that will leave your pages looking awkward with unseamly URL’s like matthewaengel.com/blog/pageid=3? This looks ridiculous, and instead I can make matthewaengel.com/blog/travel. Much cleaner, nicer, and it actually servers a purpose.

So to get this to work exactly the way I wanted, it was necessary to update my header and change the permalink structure. Eventually I would like to get my archives page functioning, but this is in the future. For now I am still thinking what categories I should develop, and would like to begin focusing my writing on alternative energy technologies and the current political situation.

Tags: · , ,