Posts Tagged by Wordpress

WordPress Clear Line Theme – Previous Page Newer Posts

The WordPress Clear Line Theme has paginators at the bottom of pages, that have links to Previous Page and Next Page. Changing them to say something like Newer Posts and Older Posts is easy – you need to edit the following four files:

  • archive.php
  • author.php
  • index.php
  • search.php

In these files, search for the lines that look like:

posts_nav_link(' — ', __('« Previous Page'),...

Edit each file and change Previous Page to Newer Posts, and Next Page to Older Posts.

Alternatively if you’ve got ssh shell access (and you’re hosted on a Unix-like environment eg Linux), you can run the following commands:

cd /var/www/wp-content/themes/clear-line
sed -i 's/Previous Page/Newer Posts/' archive.php author.php index.php search.php
sed -i 's/Next Page/Older Posts/' archive.php author.php index.php search.php

Of course before running these sed commands you should backup your files, in case anything goes wrong…

WordPress Clear Line Theme – Hide Site Admin, Login, Entries RSS

The default settings in the WordPress Clearline Theme (and most WordPress themes) will display a box of settings containing things like “Site Admin”, “Login”, “Entries RSS”, etc. This is called the Meta Widget.

Unfortunately this Meta Widget can really distract from the visual quality of your site, and it’s a slight security risk (though hiding it won’t stop evildoers from working out that you’re running WordPress).

There’s a couple of options for hiding the Meta Widget:

  • don’t display it at all. Go to Appearance -> Widgets, find the Sidebar that Meta is being displayed in, and delete it. You can then login to your blog by going to the /wp-login.php page. For example if your blog is http://myblog.info, go to http://myblog.info/wp-login.php to login
  • make it smaller and barely visible (the option I prefer). First of all, go to Appearance -> Widgets and move/add a Meta Widget to the Footer Counters Sidebar (this Sidebar is specific to the Clearline Theme). Then, you need to edit the wp-includes/default-widgets.php file. Search for the line that contains wp_register (about line 293), then delete the three lines that contain ‘rss2_url’, ‘comments_rss2_url’, and ‘wordpress.org’, and remove the bulleting from ‘wp_loginout’. The changes are easier to see with some before and after code:

Before:

<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="<?php bloginfo('rss2_url'); ?>" title=...
<li><a href="<?php bloginfo('comments_rss2_url'); ?...
<li><a href="http://wordpress.org/" title="<?php ec...
<?php wp_meta(); ?>
</ul>

After:

<ul>
<?php wp_register(); ?>
<?php wp_loginout(); ?>
<?php wp_meta(); ?>
</ul>

Now, you’ll have a small Login link at the bottom right-hand corner of your blog!

Addendum

If you take the second option (making the Meta Widget smaller and barely visible), you may have noticed you get a small “Site Admin” link when logged in (at the bottom right of the page). You can fix this by editing the wp-includes/general-template.php file. At about line 319, change:

$link = $before . '<a href="' . admin_url()...

to:

$link = '';

WordPress Clear Line Theme – Display Tags not Categories

The WordPress Clearline theme displays categories not tags for posts, and doesn’t have a way of modifying it’s behaviour through the settings area. This is easily fixed with a one line code change:

Edit the file /var/www/wp-content/themes/clear-line/functions.php, and at approximately line 340 replace:

<?php the_category(', '); ?>

with this:

<?php the_tags('', ', '); ?>

The path to the functions.php file may be slightly different on your server; you can quickly locate it using find:

find / -type f -name functions.php 2> /dev/null