Hi,
After updating to Newspaper 9, the custom code in a child theme doesn’t work anymore.
I added this to /inculdes/wp_booster/td_module.php:
function get_source_and_via() {
$postsettings = get_post_meta($this->post->ID, 'td_post_theme_settings', true);
$buffy ='';
//source
if (!empty($postsettings['td_source'])) {
$source_url = '#';
if (!empty($postsettings['td_source_url'])) {
$source_url = $postsettings['td_source_url'];
}
if (!empty($postsettings['td_source'])) {
$buffy .= '<i class="fa fa-external-link" title="Source"></i>';
}
}
return $buffy;
}
And this to /includes/modules/td_module_10.php:
<?php echo $this->get_source_and_via();?>
Is used to work, but after the update it doesn’t anymore…
I based the code on your suggestion at https://themeforest.net/item/newspaper/5489609/comments?page=527&filter=all#comment_15587309
Hello Sijpkens,
I have tested this functionality on our website and it seems to work as expected, as you can see here -> https://www.screencast.com/t/VHwIIEx9cDK
Thanks for your understanding!
Hello Catalin,
I fully understand, but it should be able to work in homepage modules as stated on https://themeforest.net/item/newspaper/5489609/comments?page=527&filter=all#comment_15587309
Hello Sijpkens,
You should get the following source function from here -> https://pastebin.com/649HGWrx and add it in td_module.php here -> https://www.screencast.com/t/oWKrFNSjjyjM After you have made this change, you should call that function to your desired module where you want to display the source. I gave you an example for module_4 like this -> https://www.screencast.com/t/DnsmKmhaAm5
Hope this helps!
Thanks for your understanding!
Hi Catalin,
Thanks for the explanation.
I put the code on the right place in td_module.php. I can place the oter code in td_module_4.php (and td_module_1.php), but when I try to place it in td_module_10.php or td_module_11.php i get this error:
Your PHP code changes were rolled back due to an error on line 27 of file wp-content/themes/Newspaper-child/includes/modules/td_module_11.php. Please fix and try saving again.
Call to undefined method td_module_11::get_source_and_via()
How can I put your suggested code in td_module_11.php?
Hi,
I have tested for module_11 (Block 12) and it seems to works as expected, as you can see here -> https://www.screencast.com/t/qbrdcyNW5
Thanks.