Issue Summary
A fatal TypeError occurs in TagDiv Composer’s td_util.php file when performing search queries on sites using the Newspaper theme. The error prevents pages from loading and disrupts user experience.
Error Details
Perform a search query (e.g., /?s=term).
Error triggers during template loading.
Root Cause
In the get_template_id method, the code assumes td_cpt option is always an array:
$td_cpt = td_util::get_option('td_cpt');
if ( !empty( $td_cpt[$post_type]['search_tpl'] ) ) {
// ...
}
However, get_option may return a string in some cases, causing the TypeError when using array syntax.
Suggested Fix
Add an array type check before access:
$td_cpt = td_util::get_option('td_cpt');
if ( is_array($td_cpt) && !empty( $td_cpt[$post_type]['search_tpl'] ) ) {
$cpt_search_template_id = $td_cpt[$post_type]['search_tpl'];
}
This affects sites with CPT searches, leading to broken search functionality. We recommend implementing this fix in future plugin updates to ensure compatibility and stability.
Hi,
You can ask your host to provide a log for the period from when you made the update until you noticed the problem.
Hi,
We are working to a theme update that will fix this vulnerability.
This will be released soon!
Hi, why has it not been fixed yet??? Everytime I update the Newspaper theme and the plugins I find this issue again. Please, fix it!.
My website has some widgets which are shown or hidden using WPML, depending on the language of the current page, but there could be any other plugin out there that hides a widget based on any condition and returns false, so this issue MUST be fixed, also considering that the PHP versions before the 8 are not supported anymore.
Good Morning,
I tried to update my (https://egzostive.com/) website’s php to the latest (8.3) via the bluehost dashboard.
After an initial boost in speed the site crashed completely (web, mobile even the WP dashboard), and I had to have it rolled back to 7.4 by the Bluehost helpdesk.
Now the website works but the mobile pages come up with a service not available message (the main page works but none of the posts, e.g. https://egzostive.com/the-ultimate-2025-car-show-and-events-list/?amp=1).
Can you have a look?
Also, what is the latest compatible php for the theme?
If it is already 8.3 how can I upgrade to 8.3 without crashing?
Thanks in advance,
Hi. According to patchstack, there is a vulnerability for tagDiv Composer Plugin <= 5.4.1 (This vulnerability is moderately dangerous and expected to become exploited. CVSS severity 7.1).
I suppose your team is already aware of this security vulnerability.
I am using the last version 5.4.3.3 of Newsmag theme.
When will the updated version be released?
Thank you.
George
Hi,
Before updating the theme, make sure that you have a full backup and check the theme plugins you are using. After the theme is updated, check that those theme plugins are updated and enabled. If the system is not updating them automatically after the theme update, you need to go to Newspaper > plugins and click on install and activate for each plugin you are using for your website.
Thank you!
Wordpress (via jetpack) is giving the error message so anyone who uses Jetpack will see the vulnerability. We need another update!
hello,
In the past, I had modified the td_config.php by adding ads blocks like custom ad 6, custom ad 7, custom ad 8… and saved some values there. Today, I want to remove those customizations while keeping the original td_config.php, but the arrays with the values I had set remain in the wp_options table. How can I clean up those unnecessary entries from the td_011_settings option?
thanks
Hello TagDiv Support,
I am using the Newspaper theme (latest version) on my WordPress site, and am experiencing critical issues with missing frontend JavaScript files and related mobile performance problems.
Description of the Problem:
On my live site, the following critical theme JS files are returning 404 errors:
/wp-content/themes/Newspaper/js/tagdiv_theme.min.js
/wp-content/themes/Newspaper/js/tdb-site.js
This results in:
Broken frontend features (menus, blocks, theme interactivity).
Console errors such as “wp is not defined” and failures for any code dependent on the wp JS object.
Failed scripts when trying to use or customize TagDiv Composer, blocks, or advanced layouts.
File/Folder Structure Verified:
My Newspaper theme is installed at: /wp-content/themes/Newspaper/
The only theme folders present are: css, images, includes, translation, woocommerce (see attached screenshot).
No top-level /js/ directory is present in the parent Newspaper theme folder.
I checked within /includes/, where there’s a separate js folder, but it contains only backend/admin scripts, not the required frontend ones.
I have unzipped the original theme package from your download. There is still no /js/ directory at the theme root with the two required JS files.
Steps Taken:
Searched and extracted all folders in the downloaded Newspaper theme package, but could not find tagdiv_theme.min.js or tdb-site.js anywhere.
Cleared all WordPress, server, and browser caches, rechecked file system and browser console—issue persists.
Verified the problem recurs with a freshly installed, untouched Newspaper theme (not a child theme or plugin conflict).
Impact:
Site is not functioning properly for end users due to missing JavaScript.
Mobile Lighthouse audits show increased load times (LCP 5.6s+), slow visual completion, and warnings about render-blocking JS/CSS, many of which are worsened by missing or broken theme scripts.
Fundamental site features and performance are degraded on mobile and desktop.
Expected Resolution:
Please provide the correct /js/ directory and the latest versions of:
tagdiv_theme.min.js
tdb-site.js
so I can properly restore these to /wp-content/themes/Newspaper/js/.
If the theme package download I received is incomplete or missing files, please advise and provide a new download link or updated theme zip.
Advise if there may be a packaging, deployment, or installation issue on your end that affects the inclusion of essential JS files.
Optional/Additionally:
Please share a recommended method to ensure all critical JS assets are retained through future theme updates and can be verified after installation.
Any additional suggestions for resolving mobile loading/Lighthouse issues when all scripts are present and loading correctly.
Thank you for your help. Screenshots of my folder structure and file audits are attached for your reference.
Best regards,
Ameet
Newspatron.com
Console error screenshot
https://drive.google.com/file/d/1WisGWNru277WMt6d0twc0EvxeIVW0XkF/view?usp=sharing
Lighthouse screenshot
https://drive.google.com/file/d/1iAFtFb6z26XJdPg4myLTj0KlIoa4qnuS/view?usp=sharing
Found the reason, with every update it disables the plugins.
-
This reply was modified 9 months by
Kaino.
Thank you for the update!
Hi,
If you’re referring to the changed_files included in the theme package, these are only provided when there are modifications to the theme files themselves. In the last two releases, the updates were limited to the theme plugins.
Hi,
Please make a full backup for the theme and update the theme to 12.7.3, if the situation is the same, then please try this: Edit the Newspaper theme and in functions.php file (wp-content/themes/Newspaper/functions.php) at the end of the file add the code from here -> https://pastebin.com/uAw5du5k then go to Newspaper theme panel, click on save settings button and check the social share if now are displayed.
Notice. After the social share are back the added code needs to be removed from wp-content/themes/Newspaper/functions.php
Thank you!
Hello tagDiv team,
I have an update regarding the search functionality errors:
Status Update:
- ✅ FIXED: The original
implode()error has been resolved in the latest version - ❌ NEW ISSUE: A critical error has been discovered at a different location
New Error Details:
Error Message: Fatal error: Uncaught Error: Cannot access offset of type array on array in td_util.php on line 1196
Problem Description: The code in td_util.php at line 1196 assumes get_query_var('post_type') always returns a string. However, this function can return an array when multiple post types are being searched. This causes a fatal error when the array is used as an array key.
Current Problematic Code (Line ~1192-1196):
$post_type = get_query_var('post_type'); if ( !empty($post_type) && $post_type !== 'post' ) { $td_cpt = td_util::get_option('td_cpt'); if ( !empty( $td_cpt[$post_type]['search_tpl'] ) ) { // ← FATAL ERROR HERE $cpt_search_template_id = $td_cpt[$post_type]['search_tpl']; } }
Proposed Fix:
$post_type = get_query_var('post_type');
// Fix: get_query_var('post_type') can return an array, handle both cases if ( is_array($post_type) ) { $post_type = !empty($post_type) ? $post_type[0] : ''; }
if ( !empty($post_type) && $post_type !== 'post' ) { $td_cpt = td_util::get_option('td_cpt'); if ( !empty( $td_cpt[$post_type]['search_tpl'] ) ) { $cpt_search_template_id = $td_cpt[$post_type]['search_tpl']; } }
Environment:
- Newspaper Theme (latest version)
- td-composer plugin (included with theme)
- PHP 8.0+
- WordPress 6.x
Impact: Search functionality is completely broken. This is a critical bug that prevents users from using the search feature on the site.
Request: Could you please include this fix in the next update of td-composer? This is a critical bug that breaks essential site functionality. The array type checking ensures compatibility with all scenarios where get_query_var('post_type') might return different data types.
Affected File: /wp-content/plugins/td-composer/legacy/common/td_util.php – Line 1196
Thank you for your attention to this matter!
Best regards
-
This reply was modified 9 months by
be2name.
Hi, here are the details:
– our blog incorrectly sets the “<meta name=’og:image’
vlaue=’uri_to_image’>” for the home page
– we want to force the value of the meta header “<meta name=’og:image’
value=’uri_to_custom_1image’>” only on the home page
– we don’t want to install a plugin for this
– we want to set the meta header with the functions.php (add_action)
– i don’t want theme updates (Newletter) to overwrite our custom functions . should i create a child theme from Newsletter just to add that function?
Hi,
This issue is already on our list. Unfortunately, our developers weren’t able to resolve all the bugs that appeared after the theme update to version 12.7.2, and we needed to release 12.7.3 as soon as possible. However, this should be fixed in the upcoming theme update!
Thank you for your understanding.
Hi,
I believe that when you updated the theme, the theme plugins were not updated. Please connect to the website and go to Newspaper > plugins and install from there the theme plugins you were using (I believe are tagDiv Composer, tagDiv Cloud Library, and maybe tagDiv Standard pack).
Thank you!
No, this is not a plugin issue, it’s a bug in Newspaper!
See here how to fix it:
https://forum.tagdiv.com/topic/subject-critical-bug-in-td_util-php-line-1196-search-functionality-broken/
There was an update today, but this bug has not been fixed by the developers.
Too bad this wasn’t fixed with the latest update 🙁
Hi, I m having the same issue “Document does not have a main landmark.” when i ran a test through PageSpeed Insight.
https://imgur.com/a/IGX14Xx
I have just updated to the latest 12.7.3 version and cleared all cache, but the issue still persists, any help is appreciated.
Thanks!
After the last update Newspaper 12.7.2, I lost the header and footer, and I can’t access the editing of my posts.
I don’t have a recent copy, only one from several months ago.
Hi,
The theme do not have a plugin such as td-theme-core.
The theme plugins can be installed after the theme is installed by accessing the Newspaper > plugins section. The core theme is tagDiv Composer plugin https://forum.tagdiv.com/newspaper-how-to-update-a-plugin/
The 12.7.3 contains some fixes for Newspaper v12.7.2
– fix for TOC
– fix composer version for XSS vulnerability
– other various fixes;
If you do not need at least one of them, then there is no need to update to 12.7.3
https://tagdiv.com/newspaper-changelog/
Same Question – the changelog doesn’t seem updated. Looking forward to knowing what changed 🙂