- TutorialsDefault Block Settings Guide
- NewspaperWP Rocket and Newspaper Theme: Optimization Guide
- TutorialsFrom WPBakery to tagDiv Composer
- TutorialsOffset Feature
- TutorialsWhat is Ajax preloading?
Please check the answer from here – https://forum.tagdiv.com/topic/flex-block-filtering-issue-current-taxonomy-term-and-specific-category-id/#post-536355
After the last update, I noticed that some features on my website are not working, such as tagDiv Composer blocks, page loading, post templates have disappeared and do not open. I ran some tests by disabling the plugins and noticed that the tagDiv Composer plugin itself is causing this. I need help, as it is affecting the functioning of my website and part of the content cannot be accessed due to the following error:
wp_booster error:
td_api_base::mark_used_on_page : a component with the ID: single_template_2 is not set.
/home1/matine35/public_html/wp-content/plugins/td-composer/legacy/common/wp_booster/td_api.php
Blocks also do not appear on the home page and only display the code:
[td_block_16 m16_tl=”20″ category_id=”7772″ limit=”6″]
Other blocks and grids simply disappeared.
Here are two links to view the problems:
Home: https://matinecinetv.com.br/
Hello again, I can only import modules at the Modules Templates area. So if I the solution you suggest is to import and modify a module with TagDiv, why not modify a block I already use?
The only thing I want to add is the code fetchpriority=”high” to the article image. Where does Flex Block 1 or in general block codes comes from? Maybe I can change the code there and make it work. I tried to find the code in the Newspaper theme but I can find it. Is this code in the plugin?
Regards
Giorgos
-
This reply was modified 9 months by
giorgoskey.
Hi, I am also facing similar issue, if you have solved, can you help me how to do it? Implementing And logic.
Like “Current Taxonomy (And – Logic) Category Filter ID” ?
This the Case I created: https://forum.tagdiv.com/topic/flex-block-filtering-issue-current-taxonomy-term-and-specific-category-id/
Hello
I see tag div shortcodes after last update.
I updated the theme and the plugins. Then re activated the plugins. But they are still there. No further update notices.
What can I do?
[td_block_1 custom_title=”In evidenza” header_color=”#dd3333″ category_id=”2″ td_ajax_filter_type=”” td_ajax_filter_ids=”” td_filter_default_txt=”Ultima” td_ajax_preloading=”preload” sort=”” el_class=”world_news_1″ f_header_font_family=”” block_template_id=”td_block_template_15″ limit=”6″ header_text_color=”#ffffff” installed_post_types=”post,posttype1,posttype2” m3_tl=”40″][td_block_11 custom_title=”test test” header_color=”#66bb6a” category_id=”112″ limit=”4″ ajax_pagination=”next_prev” sort=”” block_template_id=”td_block_template_15″
greenwoodcalendar.com
When I deactivate the built-in social counter, my site returns. Is there a way I can use the social counter with my new Newspaper 12 theme. Here is the code I received:
Uncaught Error: number_format(): Argument #1 ($num) must be of type int|float, string given
in /home/greenwx6/public_html/wp-content/plugins/td-social-counter/shortcode/td_block_social_counter.php on line 1176
Call stack:
number_format()
wp-content/plugins/td-social-counter/shortcode/td_block_social_counter.php:1176
td_block_social_counter::render()
wp-content/plugins/td-composer/legacy/common/wp_booster/td_global_blocks.php:27
td_global_blocks::proxy_function()
wp-includes/shortcodes.php:434
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-content/plugins/td-composer/includes/tdc_composer_block.php:222
tdc_composer_block::do_shortcode()
wp-content/plugins/td-composer/includes/shortcodes/vc_column.php:440
vc_column::render()
wp-content/plugins/td-composer/legacy/common/wp_booster/td_global_blocks.php:27
td_global_blocks::proxy_function()
wp-includes/shortcodes.php:434
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-content/plugins/td-composer/includes/tdc_composer_block.php:222
tdc_composer_block::do_shortcode()
wp-content/plugins/td-composer/includes/shortcodes/vc_row.php:1204
vc_row::render()
wp-content/plugins/td-composer/legacy/common/wp_booster/td_global_blocks.php:27
td_global_blocks::proxy_function()
wp-includes/shortcodes.php:434
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-content/plugins/td-composer/includes/tdc_composer_block.php:222
tdc_composer_block::do_shortcode()
wp-content/plugins/td-composer/includes/shortcodes/tdc_zone.php:806
tdc_zone::render()
wp-content/plugins/td-composer/legacy/common/wp_booster/td_global_blocks.php:27
td_global_blocks::proxy_function()
wp-includes/shortcodes.php:434
do_shortcode_tag()
preg_replace_callback()
wp-includes/shortcodes.php:273
do_shortcode()
wp-includes/class-wp-hook.php:324
WP_Hook::apply_filters()
wp-includes/plugin.php:205
apply_filters()
wp-includes/post-template.php:256
the_content()
wp-content/plugins/td-composer/legacy/Newspaper/page.php:51
include(‘/home/greenwx6/publi…y/Newspaper/page.php’)
wp-includes/template-loader.php:106
require_once(‘/home/greenwx6/publi…/template-loader.php’)
wp-blog-header.php:19
require(‘/home/greenwx6/public_html/wp-blog-header.php’)
index.php:17
Query Monitor
Correction in adobe type the css is loaded in all pages and works with classes so body p etc does not take priority. but we dont want the css to be loaded in all pages(uses import +parser blocking etc) only in the page we choose to have the font…
Hello
I’ve created a custom shortcode function in my functions.php file to show the discount percentage (e.g. “50% OFF”) dynamically on my WooCommerce product pages.
The shortcode works perfectly on desktop, and even when I view the desktop version on mobile, it displays correctly.
However, when I use a custom mobile template, the shortcode output does not appear at all.
Here’s my code setup:
functions.php
function product_discount_percentage_shortcode() {
// Ensure we are on a product page, or have a valid product context
global $product;
// Check if the global $product object is available
if ( ! is_a( $product, 'WC_Product' ) ) {
// Attempt to get product ID from the loop/query if not on single product page
$product_id = get_the_ID();
if ( $product_id ) {
$product = wc_get_product( $product_id );
}
}
// Check if we successfully have a product object
if ( ! is_a( $product, 'WC_Product' ) ) {
return '';
}
// --- Calculation and Output Logic ---
// 1. Check if the product is on sale
if ( $product->is_on_sale() ) {
// 2. Handle Simple and Variable Products differently for prices
if ( $product->is_type('simple') ) {
$regular_price = (float) $product->get_regular_price();
$sale_price = (float) $product->get_sale_price();
} elseif ( $product->is_type('variable') ) {
// For variable products, we'll calculate the *maximum* possible discount
// by comparing the highest regular price and the lowest sale price.
$prices = $product->get_variation_prices( true );
// Exit if there are no variations or prices
if ( empty( $prices['regular_price'] ) || empty( $prices['sale_price'] ) ) {
return '';
}
// Get the highest regular price and the lowest sale price across all variations
$highest_regular_price = max( $prices['regular_price'] );
$lowest_sale_price = min( $prices['sale_price'] );
// Use these for the calculation (finding the max discount)
$regular_price = (float) $highest_regular_price;
$sale_price = (float) $lowest_sale_price;
} else {
// Not a simple or variable product, so we can't calculate easily
return '';
}
// 3. Final calculation check and execution
if ( $regular_price > 0 && $sale_price < $regular_price ) {
$discount_amount = $regular_price - $sale_price;
// Calculate the percentage discount: (discount_amount / regular_price) * 100
$percentage = round( ( $discount_amount / $regular_price ) * 100 );
// Return the output string (don't use echo in shortcodes)
$output = '<span class="woocommerce-discount-percentage">';
$output .= '' . esc_html( $percentage ) . '% ' . esc_html__( 'OFF', 'your-text-domain' );
$output .= '</span>';
return $output;
}
}
// Return empty string if not on sale or calculation conditions are not met (0% off)
return '';
}
// Register the shortcode with WordPress
add_shortcode( 'product_discount_percentage', 'product_discount_percentage_shortcode' );
CSS :
.woocommerce-discount-percentage {
display: inline-block;
padding: 7px 8px;
margin-left: 0px;
background-color: #e44d26;
color: #ffffff;
border-radius: 4px;
font-size: 0.9em;
text-transform: uppercase;
line-height: 1;
}
.woocommerce-discount-percentage strong {
font-weight: 700;
font-size: 1.1em;
}
.summary .price + .woocommerce-discount-percentage {
margin-left: 10px;
vertical-align: middle;
}
Shortcode Used: [product_discount_percentage]
so finally the issues is
Works fine on desktop version.
Works fine when viewing desktop layout on mobile browser.
❌ Does not display when using a custom mobile template.
Could you please confirm:
How can I make this shortcode work inside tagDiv mobile templates?
Hi TagDiv Team,
Like some other users, I’m consistently getting the following error when editing new pages or the homepage (but not posts): Error at zones: 6(models): 0(dom) “The model does not match the content. Current state has involved an issue.”
This even happens immediately after I download one of your pre-built templates—even before adding any shortcodes.
What I discovered:
After some testing, I found that if I use the “Post Type Switcher” plugin to change the page type (in the Classic Editor) from Page → Cloud Template, the error in Composer disappears completely!
Once I do that:
I can edit the page in Composer without any errors.
The layout works as expected.
However:
The page is then removed from the Cloud Template list, since it’s technically no longer a “Page” it is a Cloud Template type.
It only displays properly if I access it through a URL like
https://example.com/tdb_templates/news
If I try to access it normally at https://example.com/news, I either get a blank page or a critical error.
My theory
It seems that posts don’t trigger this error because the Theme Panel → Templates section includes a redirect or link definition for posts and single templates. That likely ensures TagDiv Composer initializes the correct “zone” mapping.
For pages and the homepage, there’s no equivalent setting in the Theme Panel, so Composer may be loading the wrong internal model—hence the zone mismatch.
The problem
At the moment, I can’t create or edit any new pages or homepage layouts without this error.
Only posts work normally.
Possible solution idea
If my guess is right, perhaps the Composer needs a way to assign a Cloud Template mapping (like the Post templates) for Pages and Homepage in the Theme Panel. That might resolve the zone mismatch entirely.
Do you have any other workaround or insight on this?
It’s currently blocking all new page and homepage creation.
Thanks for your help!
Hi,
What I will recommend is to create your own blog page using tagDiv Composer, set a flex block that you like the most and adjust it according to your needs.
If you want to use the blog option provided by wordpress – https://i.imgur.com/14YPlku.png, then you’ll need to install tagDiv Standard Pack from Newsapper > plugins and select from the theme panel the module layout you want for your blog – https://i.imgur.com/LyzqlLB.png
Thank you!
Hi, the unique articles is enabled and must stay enabled, because I don’t want to show duplicate articles my homepage. I question myself, how is it possible that the firt block displays a latest post? Shouldn’t Unique Articles work from the second block on?
Hello tagDiv Support Team,
I am building a generic Taxonomy Archive Template using the tagDiv Cloud Library/Composer. This template is assigned to a Custom Taxonomy (e.g., prompts) and needs to load correctly for all terms within that taxonomy (e.g., /prompts/term-A, /prompts/term-B, etc.).
My goal is to display content in two separate Flex Blocks, each filtered by the current taxonomy term AND a specific Category ID.
1. Goal (Desired Query Logic):
I need to enforce the following AND logic within each Flex Block, dynamically, without hardcoding the current Taxonomy Term ID:
Section 1 (Text Posts): Posts must belong to (Current Taxonomy Term) AND (Category ID 87).
Section 2 (Image Posts): Posts must belong to (Current Taxonomy Term) AND (Category ID 88).
2. Current Setup (Flex Block Filter Settings):
I am using a Flex Block and configuring the Filter tab as follows (for Section 1, Category ID 87):
Category filter: Taxonomy – Current (Used to inherit the current term)
Multiple terms filter: 87 (Hardcoded ID of the specific category)
Posts(cpts) must belong to all terms: Checked (Intended to force the AND logic)
3. Issue/Failure Point:
Despite setting the Posts(cpts) must belong to all terms checkbox, the Flex Block query is incorrectly executed.
Observed Result: The block is showing posts that belong to Category ID 87 but are associated with OTHER, unrelated taxonomies or terms outside of the current archive page.
Example: When viewing /prompts/term-A, the block is showing posts tagged with Category ID 87, but whose main taxonomy term is from a different, unrelated taxonomy (e.g., from the guides taxonomy or another custom taxonomy).
4. Request:
Could you please advise on the correct combination of settings within the tagDiv Flex Block or provide a precise workaround to generate a strict, generic WP_Query that enforces the dynamic (Current Taxonomy Term) AND (Specific Category ID) relationship?
If this combination is not possible via the standard UI, please provide a filter or shortcode parameter that achieves this specific tax_query requirement.
Thank you for your time and assistance!
Hello after updating toNewspaper to 12.7.3 my whole Template including header background image and logo an all settings where crasht. My Site came up with a complete new lauyout and I did not find my old settings in my Theme Panel.
Is it the intention that only cloud templates are available? I actually use a child theme to prevent this, but it probably has something to do with the Tagdiv Composer settings.In any case, my homepage became just a news list without all the layouts and texts selected in the TAGDiv Composer and using tagdiv Standard Pack
Hi,
The current category filter can be used for the category template only – https://i.imgur.com/kfrXffj.png https://i.imgur.com/CMwYP6a.png that is a special filter like the other special filters – https://forum.tagdiv.com/flex-block-settings-guide/ https://i.imgur.com/22eTYdS.png
Thank you!
Hi,
This can be done if you create your own module using the module builder – and this can be displayed using flex block builder – https://forum.tagdiv.com/flex-block-builder-flex-loop-builder/ https://i.imgur.com/VeS1BU6.png https://i.imgur.com/yAPNRMT.png
Thank you!
Flex Block module 1
Hi Niclas,
Wordpress creates an extra 3 thumbs https://i.imgur.com/CFLHw5U.png and the rest of them depend on the number of teh thumbs you have enabled in the theme panel. Those are used for different blocks and https://forum.tagdiv.com/theme-thumbs/ and can be enabled and disabled. Also, you can remove those thumbs that are not in used using this plugin https://wordpress.org/plugins/force-regenerate-thumbnails/
Thank you!
Hi,
About the image set with css background, what can be done is to create a module for the layout you want and replace the first block that is displayed when you enter the website. The module made with the module builder will use img tags for images and can be set in the flex block builder element.
Related to the Image Optimization, use a plugin like https://wordpress.org/plugins/ewww-image-optimizer/ and enable the webp format and from the theme, use this option – https://i.imgur.com/6qMAN1H.png
Also, if you are using the WP Rocket, you can check our guide with this plugin https://forum.tagdiv.com/wp-rocket-and-newspaper-theme-optimization-guide/
Thank you!
I want to add article tag below the article meta information area of the flex blocks/ flex grids. Is it possible to do this?
https://drive.google.com/file/d/1K2hS7Rqc4Qo4YuHMNivyhG6Ym_g3dv4w/view?usp=drivesdk
I use the Classic template.
At the very top I have Flex Block 2 and the latest post is displayed there. Below I have Posts Loop and I would like the latest posts to be displayed there, but apart from the one displayed in Flex Block. This means that the newest ones will be displayed in Posts Loop, but without the most recently written ones. I don’t want a duplicate on the home page.
Hello
I’m getting the following PHP deprecation warning on my website:
Deprecated: Creation of dynamic property tds_w_favorite1::$unique_block_class is deprecated in /home/u707263619/domains/grookfit.com/public_html/wp-content/plugins/td-woo/styles/tds_w_favorite/tds_w_favorite1.php on line 17
After checking the file, I found that the issue was due to creating a dynamic property directly on the class, which is deprecated in newer PHP versions (8.2+).
To fix the issue, I modified the code as follows:
Before (original code):
$this->unique_block_class = $td_block_layout->get_unique_block_class();
After (fixed code):
if (property_exists($this, 'unique_block_class')) {
$this->unique_block_class = $td_block_layout->get_unique_block_class();
}
or alternatively, I declared the property inside the class definition like this:
class tds_w_favorite1 extends td_block {
public $unique_block_class;
function __construct() {
$this->unique_block_class = $td_block_layout->get_unique_block_class();
}
}
This resolved the deprecated notice successfully.
I just wanted to confirm if this is the correct and recommended approach for this plugin.
Hi
I’m writing to you about the critical mobile performance issues on trikalatroll.gr. While the site’s SEO and Accessibility scores are excellent, the user experience is suffering due to extremely slow load times.
Here is the latest Google PageSpeed Insights report for your review: https://pagespeed.web.dev/analysis/https-trikalatroll-gr/laf5cx5p3t?form_factor=mobile
The most urgent problems that need immediate attention are:
Critical LCP (Largest Contentful Paint) Time: The mobile LCP is 10.6 seconds, which is far above the 2.5-second threshold.
LCP Element Implementation: The primary cause seems to be that the main article thumbnail (the LCP element) is being loaded as a CSS background-image on a <span> tag. This prevents the browser from discovering and prioritizing the image load. This must be changed to a standard tag with fetchpriority=”high” to fix the LCP delay.
Slow FCP (First Contentful Paint): The FCP is 5.9 seconds. Users are waiting almost 6 seconds to see any content on the page.
Render-Blocking Resources: There are significant JavaScript and CSS files blocking the initial render. These need to be properly deferred or inlined.
Image Optimization: Images are not being served in next-gen formats (like WebP) and are not properly sized for mobile, which significantly increases load time.
Could you please prioritize fixing these issues, especially the LCP background-image problem? These optimizations are essential for improving our user experience and maintaining our search rankings.
Thank you,
Hi,
The Big Grid Flex elements do not have a radius option for images, only the Flex block has this option.
Thank you!
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