「WP related」カテゴリーアーカイブ

Warning with PHP upgrade to 7.3

Warning: count(): Parameter must be an array or an object that implements Countable in …/wp-includes/post-template.php on line 310?

The following patch in the “post-template.php” was successful.

/*    if ( $elements['page'] > count( $elements['pages'] ) ) { // if the requested page doesn't exist
         $elements['page'] = count( $elements['pages'] ); // give them the highest numbered page that DOES exist
     }
 */ //replaced by the following 2019/11/11 k.n.
 if ( ! empty( $pages ) ) {
     if ( $page > count( $pages ) ) // if the requested page doesn't exist
         $page = count( $pages ); // give them the highest numbered page that DOES exist} else {
    $page = 0;
}
//replace end


WP move to subdirectory

  1. “japantourguide.net” has been installed in the root directory.
  2. Move everything except the directories for the sub-domains to the new japantourguide directory.
  3. Without modifying the “.htaccess” which is suggested by the WP.org, only change the directory in the LoLipop users setting.

webwork2@murakoshi-site

1.Again work on jtg1.japantourguide:Akismet activated key
52beeb76581d
2. Experienced many times “cannot login”. They were kind of cleared by renaming plugins and themes using ftp.
3. Finally became in good shape by recovering appropriate themes adventure and adventure-child.
4. There remains: on mobile (at least my m03), contact form submit button barely accessed.

webwork @murakoshi site

  1. After many troubles, restoring site and databases backups @2019.10.24 recovered almost everything.
  2. Backup site and databases @2019.10.30.
  3. But japantourguide.net cannot be logged in. Forget about this for the moment.
  4. and work on jsst4.japantourguide.net. It was working fine under wp4.9.12 ; updating all the plugins caused that strange black boxes; deactivating Autoptimize cleard that strange boxes.
  5. Based above, on japansightseeigtour.jp, deactivated Autoptimize, balack boxes gone.: Good Job!
  6. Back on jsst4: placed debug agent @wp-config.php;activated Akismet;reCAPTCHA set as jihsankn; akismet set on Mt.fuji contact; successfully reject trivial spam.;failed to introduce flamingo because of wp version.;now wp vesion up to 5.2.4 succesfully;seemingly all right;php version up to 7.3(CGI);php version up require message gone; still everything seems fine.;Now backup the site and related databases.
  7. Now work on jtg1: at the beginning, jtg1 site was not completely secure, but by clearing the discussion acceptance, the site turned to be secure.;activate Akismet key52beeb76581d;wp3.9.29 was running all right.; update to wp3.9.23?;still cannot get appropriate wp update;
  8. Because php update to 7.3(CGI) on jsst4 went without any problem, same php update was performed on japansightseeing, without any problem.
  9. jtg1 has the problem of inability of automatic wp core update, thus try manual update.; Following the procedure described at wp official site manual update to latest wp 5.4.2 went rather smoothly. Everything is seemingly O.K.;
  10. Now work on japantourguide: Could not be logged in. Manual wp update seemed only one choice.; Following the official procedure, updated to wp 5.4.2. Still could not be logged in 2 notices and 2 warnings.; Renaming pluginsX,was able to be logged in without any notices and warnings.; Activated akismet key 52beeb76581d;
  11. Remaining issues:1.Akismet&CF7&reCAPTCHA does’t work at japantourguide; 2.Either php7.1 or7.3 makes FATAL ERROR at japansightseeingtour/dashboard when clicking plugins at sidebar.
  12. japansightseeingtour: update php7.3 was O.K. by deactivating WP-editor, thus deleted this plugin.;Noteworthily,PHP Compatibility Checker could not detect the WP-Editor imcomatibilily to PHP7.1 nor 7.3.; This site claims to be healthy by Site Health Checker @2019/11/04. Remains: cannot set akismet protect on Homepage contact.

WP migration from localhost/kblog to nakym2.tokyoguide-noriko.net

The following is not the actual process performed, rather organized or cleaned process.

 1. Open new subdomain nakym2.tokyoguide-noriko.net
1.1 login to lolipop:
1.2 make subdomain: nakym2.tokyoguide-noriko.net
1.3 WP簡単インストール:

2. The following process is performed by FFFTP preferably on oldKiyoshi.
Source means 192.168.0.17/kblog/, target means nakym2.tokyoguide-noriko.net/.
2.1 In target: rename: wp-content -> wp-content.nakym2.org, wp-config.php->wp-config.php.nakym2.org
2.2 Copy wp-content,  of source to target /. ( first download to local then upload to target)
2.3 download wp-config.php from source -> rename wp-config.org.php
2.4  download wp-config.nakym2.org ->rename to wp-config.php
2.5  Rewrite wp-config.php: change database prefix to the original source one; upload to target.
2.6  upload murasecret (better) or knsecret to target /
2.7  export database from source and import to target.
2.8  visit murasecret or knsecret at target site and perform necessary procedure.
2.9  Done!

301 redirect

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^jtg1\.japantourguide\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.jtg1\.japantourguide$
RewriteRule (.*)$ http://jsst4.japantourguide.net/$1 [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

responsive to unresponsive

Add this cssAdd this css
/* =Fixed Width——————————————————– */#container,#footer { width: 960px!important;}Add this php to the functions.php in the child theme
// Disable media queries<?phpfunction remove_media_queries() {wp_dequeue_style( ‘responsive-media-queries’ );}add_action( ‘wp_enqueue_scripts’, ‘remove_media_queries’, 20 );?>You may also need to remove or comment out the viewport meta data in your child theme’s header.php file.
Further info here