irislines web design
irislines web design

Category as body class in WordPress

Wanting more handles for CSS styles — to style a widget in different colors for different categories of posts — I found this snippet:

// add post category slug to body class in wordpress
function wcs_add_category_slug_body_class( $classes ) {
global $post;
if ( is_single() ) {
foreach ( get_the_category( $post->ID ) as $category ) {
$classes[] = $category->category_nicename;
return $classes;
add_filter( 'body_class', 'wcs_add_category_slug_body_class' );;

which did the trick!

The site that had the snippet:

Add Post Category Slug to Body Class in WordPress



New Captcha fails if server clock is not synced

If you are comfortable with WHM this is easy to do via WHM> Server Time> Sync Time With TimeServer.

This has happened a few times — it took lots of research the first time, the second, I called and asked my host company to snyc the clock.

After they fixed it, they let me know this was something I could do myself. I just need to remember!

How to force SSL with .htaccess

If you want to force your entire website to go through https, you can add these rules to your .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

from Siteground tutorial at

Continue Reading in Warp 7 themes

This from a yoo_theme support thread:

Step 1: Make a copy of the file below:


create the /styles/STYLE-NAME/layouts directory, copy the file in there and start adding your own PHP code. 

Placing the <!–more–> will always show the text link for more content as well as serve as a way to identify where the post content should be cut off on archive / search pages. If you place the <!–more–> tag at the end of the post content, the text link for more content will still display.

In addition to Bruce’s suggestion, I’d use the following line instead:

<div class="content clearfix"><?php the_content(__('Continue Reading', 'warp')); ?></div>

This will preserve your theme translations via the theme provided PO file.

Also, remember to remove or comment out the line below:

<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php _e('Continue Reading', 'warp'); ?></a>

WordPress – error in establishing database connection.

This happened today when trying to view the front end of a site.

1.  I  tried to access the wp-admin.

2. A message came up saying one or more tables needed to be repaired.

3. I followed instructions for adding define(‘WP_ALLOW_REPAIR’, true);  to the config.php file.

4.  I tried again to load wp-admin and was offered the choice to have it attempt database repair.

5.  It failed.

6.  I went to phpMyAdmin and selected the wp_options table and initiated repair.

7.  Happy Ending.   All is well again.


Widgetkit2 on WordPress – issue with lightbox nav on touch devices.

Posted to the yoothemes support forum:

Note to self:  this came up in working on the new WordPress site for  Will apply to, too as I use widgetkit2 there as well.  I hope they reply!

Why is the lightbox navigation hidden on touch devices? Widgetkit2 WordPress Master Theme

I have successfully used the original Widgetkit, but on a new site decided to use Widgetkit2. There’s a lot to like now that it has galleries as well as slideshows.

BUT… When I display images in a gallery, enable Lightbox, the buttons to advance to the next image are not available on the ipad.

Apparently you decided they should only be displayed when the target area is hovered — but how can we hover on a touch device?

I have “solved” the issue by changing theme.css (in my styles folder) ~ line 8245 from display: none to display: block. This makes the navigation obvious to all, whether on a touch device or not.

I also had to disable line 7589 .uk-touch uk-hidden-touch {display:none;}

I will follow up with a layout override to remove this class from the .uk-slidenav and then be able to re-enable that line.

But WHY would you set this to hide the navigation on a touch device? Is there an alternative navigation method ipad users are supposed to use?

UPDATE: To remove the class of “uk-hidden-touch” from the lightbox navigation buttons I had to modify this file:


I don’t think it’s possible to do this as a template override, so I may have to do this again if I update the plugin.

Was there a better way?


Barb Ackemann, of created this blog to be a place to record solutions she finds in her web development work. While the title of the blog started out as “Joomla Solutions”, there are posts on html, css, Internet Explorer bugs, Joomla!, Word Press or other web-related languages, programs or tools.

The focus is on recording the solutions she finds or develops, NOT on sharing or posting un-solved mysteries, issues or problems, but the original problem will be summarized to provide context for the solutions.

The blog posts have been migrated from Joomla (with MyBlog extension) into a new WordPress site.  Tags will have to be re-entered to facilitate searching.


Blog images upside down on iPhone or iPad

Recently a client observed that photos she uploaded to her WordPress blog appeared fine on her computer, but were upside down when viewed on an iPhone or iPad.

This is NOT a problem if you prepare your images for use on the web by editing them on your computer. 

I have been recommending  for patrons who don’t have photo editing software — or don’t know how to use what they’ve got. 

Images optimized at retain the camera’s exif data and if you rotate the image in the edit process it will be fine in operating systems and software that ignores the EXIF data, but cause problems in iOS devices that DO pay attention and “correct” the image per the instructions saved in that data.

Continue Reading

yoo_master2 theme lacks support for “readmore” in WP


in warp/systems/wordpress/layouts/_post.php  find this:

<?php the_content(''); ?>

and replace with :

<?php global $more; $more = 0; the_content('Read the full article...');?>

Then lower down in the document find and comment out the Continue Reading link which would appear whether you had added “more” break or not.

<!--<li><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
<?php _e('Continue Reading', 'warp'); ?></a></li>-->



IrisLines LLC
101 Washington Street
Brattleboro, VT 05301

802 257 7391