Archive for category WordPress tips

How to optimize WordPress for iPhone?

Q. What’s a good and easy way to optimize WordPress for the iPhone/Ipod touch etc. ???

A. WPtouch :-) . Here’s some more info:

WPtouch iPhone Theme « WordPress Plugins http://wordpress.org/extend/plugins/wptouch/With a single click, WPtouch transforms your WordPress blog into an iPhone application-style theme, complete with ajax loading articles and effects, when viewed from an iPhone,…

To use the plugin with Weblogs.us hosting:

  1. download it
  2. unzip it
  3. upload it via FTP to: /wp-content/plugins/wptouch/
  4. active the plugin from your WordPress administrative interface

Enjoy!

Weblogs.us - Blog Freely

Weblogs.us – Blog Freely – Free WordPress Hosting - Free volunteer based blog hosting. Since 2003.

No Comments

Snazzy Archives Error [solved]

The  Snazzy Archives plugin is a cool WordPress plugin for outputting snazzy archives.

However, it seems that something in the latest update of the plugin (or possibly of wordpress) is causing some problems:

Just allowed the latest plugin update this morning. My archive still displays… but shows this message above it…

Help !
Don’t know why I’m receiving the following error message, after the latest upgrade:

Don’t know why I’m receiving the following error message, all of a sudden, after the latest upgrade…

The problem lies in the following code:

<?php
/*
Template Name: Snazzy Archives
*/
?>
<?php get_header(); ?>
<p align="center">
<?php if (isset($SnazzyArchives)) echo $SnazzyArchives->display(); ?>
</p>

Which spits out out an error message similar to:

Warning: Missing argument 1 for SnazzyArchives::display(),  called in /wp-content/themes/amazing-grace/Snazzy.php on line 11 and  defined in wp-content/plugins/snazzy-archives/snazzy-archives.php on line 290

Here’s a solution, change the appropriate section above by adding in two quotation marks in the display function call:

<?php if (isset($SnazzyArchives)) echo $SnazzyArchives->display(""); ?>

This worked when I was fixing the archive on my friend’s blog. I hope it helps you too if you’re having a similar problem :-) .

,

No Comments

Hiding particular categories on a WordPress blog frontpage

I decided to hide my techie posts (a particular category of posts) from the home page of my blog. The rationale is that most of the people visiting my homepage are friends and family that don’t really want to read the techie stuff, so why should I show those posts on the frontpage? Conversely, most Google visitors are searching for the techie stuff so I still want to leave in on my blog.

I did some googling and found an easy solution, which required a simple tweak to work correctly on my blog. This should work for WordPress 2.7 and most themes…

Step 1. Edit your main WordPress theme’s primary template file, normally index.php
You can edit either in the the theme editor (Appearance ->Editor) or you if you have FTP you can edit the files that way.

Step 2. Find the code similar to:

<?php while (have_posts()) : the_post(); ?>

and below it insert:

<?php if (in_category(YOUR_CATEGORY_ID) && is_home()) continue; ?>

and replace YOUR_CATEGORY_ID with the id number of the category you want to hide. Go into Posts -> Categories and look at the URLs of the categories to find your id numbers, specifically hover over the “edit” link for the category and you should see something similar to this:
http://www.yourblog.com/wp-admin/categories.php?action=edit&cat_ID=32
so in this example the number you would use would be 32.

Here is what you would have in your index.php file:

<?php while (have_posts()) : the_post(); ?>
<?php if (in_category(32) && is_home()) continue; ?>

And to disable/hide multiple categories you can do the following… which will hide any posts with category ID 32, or category ID 9:

<?php while (have_posts()) : the_post(); ?>
<?php if ((in_category(32) | in_category(9)) && is_home()) continue; ?>


I hope this has been helpful to you!

Best regards,
-J.D.

NOTE: Original credit for the single category hiding code goes to http://www.cubeshack.co.uk and though the content doesn’t seem to appear there anymore, it is mirrored on livejournal.

No Comments