Archive for the ‘Wordpress’ tag
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).
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!
Ed's Big Plans