Source doesn't work after update

Posted in: Newspaper
Post count: 13

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…

Post count: 13

When I try to place <?php echo $this->get_source_and_via();?> into the editor, this error is shown:
Call to undefined method td_module_10::get_source_and_via()

Post count: 13
Post count: 23312

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!

Post count: 13

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

Post count: 23312

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!

Post count: 13

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?

Post count: 23312

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.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.