Hi there,
If you want to modify the plugin’s widget strapline you don’t need a Factual API account; this is only needed if you’re going to be using the [wpq_locality]
or [wp_quadratum_locality]
short-codes.
To modify the strap-line, you’ll need to code a filter hook function in PHP that will be invoked when the plugin calls the wp_quadratum_strapline
filter as part of one of your pages loading.
That means you’ll need to have a reasonable knowledge of how the WordPress filter and hook mechanism works and how to code a function in PHP that does what you need to do.
The quickest way to do this is to install another plugin that allows you to run custom PHP scripts; WP Customizer can do this for you (as well as loading custom JavaScript and CSS as well; custom JavaScript won’t be needed for this but custom CSS might if you’re not happy with how the strap-line is styled). For transparency’s sake, this plugin is also one of mine, which I wrote as a convenient way to answer this sort of question. You’ll find more detail on the thinking behind this plugin and how to use it here.
After installing and activating the plugin, you’ll need to enable custom front-end functions, then create a PHP source file called strapline.php
in a subdirectory called functions
which will be located in the directory that contains your WordPress root.
In strapline.php
, you can then copy and paste the sample filter hook that’s in the plugin’s documentation. It looks like this …
<?php
add_filter('wp_quadratum_strapline', 'format_strapline', 10, 2);
function format_strapline($content, $params) {
// $params = array (
// 'venue-url' => '4Sq venue url for checkin',
// 'venue-name' => 'checkin venue name',
// 'checked-in-at' => 'timestamp of checkin'
// );
$strapline = '<h5>Last seen at <a href="' . $params['venue-url'] . '" target="_blank">' . $params['venue-name'] . '</a> on ' . date('l jS \of F Y h:i:s A', $params['checked-in-at']) . '</h5>';
return $strapline;
}
?>
This will give you a working implementation of the strap line filter. You’ll then need to amend the value of the $strapline
variable to give you the format and display you need.
Hope this helps
-Gary