Support Forum

Template Tags – Disappearing page content

JY Jonathan Yee
Jonathan Yee
Member

I have recently updated SimplePress to 6.6.3 and am running into an issue where adding shortcode [sp_newest_topics limit=2 itemOrder=T beforeTopic=””] is causing my Elementor page content to not appear in the DOM. I am using the sp_newest_topics shortcode within an Elementor shortcode. Deactivating the SimplePress plugin brings back the page content. 

Separately, I also get an error when trying to edit the page within Elementor as follows:

PHP Fatal error: Uncaught Error: Call to undefined function sp_abort_display_forum() in /mnt/efs/sp-resources/forum-plugins/template-tags/library/sp-NewestTopics-tag.php:79

Adding the following code into my theme’s functions.php allows me to access the Elementor page editor:

if (!function_exists(‘sp_abort_display_forum’)) {
  function sp_abort_display_forum() {
    return;
  }
}

 

Any ideas? The first issue has higher priority. 

2 Answers

New Answer

JI jim
jim
Member

Any feedback on this?

I’ve encountered the same error, only when trying to load the Widgets tab of the dashboard:

Error thrown

Call to undefined function sp_abort_display_forum()

The error goes away and widgets admin loads properly when Template Tags SP plugin is deactivated. Will start new topic with more details…just wanted to search first, and found this related topic.

JY Jonathan Yee
Jonathan Yee
Member

I actually revisited this issue and noticed in the latest version of the template tags plugin, an include was added to a similar file (sp-HotTopics-tag.php) solving the problem for another tag. 

Adding this line of code in the tag function before sp_abort_display_forum() like so fixes the issue for me: 

function sp_do_sp_[InsertAffectedTag]_tag($args=”) {
  require_once SPBOOT.’site/sp-site-support-functions.php’;
  if (sp_abort_display_forum()) return;
  …

I believe this may be a bug and should be applied to all template tag functions in an update for the template tags plugin. Currently it’s only applied to the one in sp-HotTopics-tag.php.