irislines web design
irislines web design

Default Country

Wanting to help out U.S. based users of The Events Calendar, I tracked down a place to set the default country.

wp-content/plugins/the-events-calendar/src/Tribe/Default_Values.php

I changed this:

public function country() {
    return array( '','');
}

to this:

public function country() {
    return array( '','United States');
}

United States is preselected, and a selection of states is generated. All other countries are still available, should they be needed.

It appears other defaults could be set as well, but I didn’t try it.

This file will need to be re-modified when updates are applied, as it is not in a location that can be accomplished with a template override.

WP Fastest Cache Settings

I had an intense afternoon:

Using Chrome with WP Fastest Cache turned ON,  homepage slide show, email list accordion, and calendar map view all worked.

But,,,  with WP Fastest Cache turned OFF,  these same elements failed in Safari and Firefox.

I finally found that by tweaking the settings of WP Fastest Cache, I could get all working in all 3 browsers.

I turned off option to combine css files and to combine js files.

WP sites not loading after updates

May, 2018.

This turned out to be a problem with the php allocation.

From Liquid Web tech support:

During our conversation, we found that your site was not loading properly due to the memory_limit being lower than what was needed to load the site. I raised it from 64M to 128M, which brought it back into working order.

I did this by adding the following line to public_html/.user.ini:

memory_limit=128M

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 ^(.*)$ https://yourdomain.com/$1 [R,L]

from Siteground tutorial at https://www.siteground.com/kb/how-to-force-ssl-with-htaccess/

Continue Reading in Warp 7 themes

This from a yoo_theme support thread:

Step 1: Make a copy of the file below:

/yoo_theme_wp/warp/systems/wordpress/layouts/_post.php 

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 takingrootfilm.com.  Will apply to froggybottomguitars.com, 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:

widgetkit/vendor/assets/uikit/js/component/lightbox.min.js

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?

About

Barb Ackemann, of IrisLines.com 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.

IrisLines LLC
101 Washington Street
Brattleboro, VT 05301

802 257 7391

info@irislines.com