This is an attempt to share how far I’ve got to understand the Liveblog plugin for WordPress.

The WHATTA moments

0
March 2, 20187:36 pm

First Issue: The first error key

The first objective is to make the plugin work and I’ve done so in development server. Here, a simple install from wordpress.org wasn’t enough. I got the first error…

first error
first error

That’s because the request is sent to non-https url. Solution: change siteurl and home in wp_options to ‘https://{domain-name}’.

March 3, 20182:51 am

Resources key

At the moment, at wordpress.org, the plugin has got average rating of three stars and quite disheartening number of issues (see github).

This is definitely not for the faint-hearted.

March 3, 20182:56 am

Too far gone past midnight… Need to get some sleep!

March 3, 20189:37 am

Issue #2: ‘Wonky’ Time key

It’s described as such in issue #333: the human-friendly time doesn’t reflect the timezone in the General setting. I applied the ‘patch’ manually as described in the comment by gerhardsletten.

Added in the {theme-directory}/functions.php


add_filter( 'liveblog_settings', function( $settings ) {
	if(isset($settings['utc_offset']))
		$settings['utc_offset'] = get_option('gmt_offset') * 60 * 2;
  return $settings;
}, 10, 1 );

wonky indeed

March 3, 20189:47 am

 

March 4, 201810:30 pm

!@#! These headache-inducing templates! A WYSINOTWYG! The front-end, managed by React’s app.js, doesn’t use key events and live blog entries templates in either its own {default-dir}/ or user-filtered template path…


apply_filters( 'liveblog_template_path', function($path){
      ....
      return $newpath;
}, 10,1); 

Have to rebuild app.js………… ouch!

March 4, 201810:46 pm

More filter applied for number of entries per page:



add_filter( 'liveblog_number_of_entries', function( $number ) {
	  $number = 10;
	  return $number;
}, 10, 1 );


March 5, 20189:12 am

sidenote: the ‘default’ package of this plugin looks similar to the structure of live-blogging/reporting at The Guardian website, such as their 90th Oscar Live Report.