(Slide) element does not display if only one post exists

Posted in: Newspaper
Post count: 74

The (Slide) element can be found under (Extended shortcodes). If only one post is available for the Slide element, it will not display. If two posts are available, it will display properly.

I found the (Slide) element in the TagDiv composer.

The issue can be seen on the following page: https://www.wheredoitakethekids.com/place-categories/ . The last row does not display one (Slide) element.

I am using the latest version of WordPress and Newspaper. I tested this with both the Chrome and Firefox browsers.

Post count: 27744

Hello,

For me work well the slide with only one post set -> https://i.imgur.com/lZVfqST.jpg
Please let me know what plugin you use.

Thank you!

Post count: 74

It looks like this file has the issue:

./public_html/wp-content/plugins/td-composer/legacy/Newspaper/includes/shortcodes/td_block_slide.php

if ( $this->td_query->have_posts() and $this->td_query->found_posts > 1 ) {

If you change the > sign to a >= sign, it works.

The above code is found in the render function.

Post count: 27744

Hi,

I verified your website again, and now see the slide works well -> https://i.imgur.com/n40Ut92.jpg

Thank you!

Post count: 74

Yeah, I made that code change.

Here’s the change:

if ( $this->td_query->have_posts() and $this->td_query->found_posts >= 1 ) {

Post count: 74

This is a bug in the Newspaper theme.

./public_html/wp-content/plugins/td-composer/legacy/Newspaper/includes/shortcodes/td_block_slide.php


...
if ( $this->td_query->have_posts() and $this->td_query->found_posts > 1 ) {
...

The slider will not show any posts if only (one) post is available. The above code should have the (>) changed to (>=). Below is what the code should be:


...
if ( $this->td_query->have_posts() and $this->td_query->found_posts >= 1 ) {
...

Post count: 27744

Hello,

I have added this issue to our list for investigation.

Thank you!

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