PHP error in theme…

Posted in: Newspaper
Post count: 73

See the below error which is coming in php_errorlog file

[08-Oct-2016 04:10:36 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE AND comment_parent IN (29268) ORDER BY comment_date_gmt ASC, comment_ID ‘ at line 1 for query SELECT ob3hhj0y_comments.comment_ID, ob3hhj0y_comments.comment_parent WHERE AND comment_parent IN (29268) ORDER BY comment_date_gmt ASC, comment_ID ASC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newspaper/mobile/single.php’), comments_template, WP_Comment_Query->__construct, WP_Comment_Query->query, WP_Comment_Query->get_comments, WP_Comment_Query->fill_descendants

[08-Oct-2016 04:10:36 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE AND comment_parent IN (33456,33515) ORDER BY comment_date_gmt ASC, comme’ at line 1 for query SELECT ob3hhj0y_comments.comment_ID, ob3hhj0y_comments.comment_parent WHERE AND comment_parent IN (33456,33515) ORDER BY comment_date_gmt ASC, comment_ID ASC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newspaper/single_template_5.php’), comments_template, WP_Comment_Query->__construct, WP_Comment_Query->query, WP_Comment_Query->get_comments, WP_Comment_Query->fill_descendants

The file is more than 1 Gb with these repeated errors…

Post count: 73

Further investigation we found the below syntax error Under mobile>>single.php line 29

<article id=”post-<?php echo $td_mod_single->post->ID;?>” class=”<?php echo join(‘ ‘, get_post_class());?>” <?php echo $td_mod_single->get_item_scope();?>>

In ending > is used twice…..it should be once only….please check the syntax and confirm…

Also, in same file in below code of piece:

<div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_comments();?>
<?php echo $td_mod_single->get_views();?>
</div>

Date set to false is it correct..???

Post count: 22421

Hi,

I’m not sure about the top errors, The ones on the bottom are not errors and the syntax is correct
The 2 > signs come from 2 closing taqs. A closing php tag at the end of a html tag that together form this ?>> http://screencast.com/t/sXXrXYESkqW9 The syntax is correct for this part as well:

get_author();?>
get_date(false);?>
get_comments();?>
get_views();?>

I suggest you search for a few php tutorials as a reference.

The top errors seem to be database errors which have nothing to do with the theme so please switch to a standard wp theme and test again.

Thank you!

Post count: 73

Top 2 errors are with PHP 7 and theme code is not compatible with PHP7 and after switching it to PHP5 error goes…

Post count: 22421

Hi,

Well we have not tested our theme with php 7 yet so i cannot say for sure. Some users claim it works some claim it doesn’t
We do not recommend php 7 as we have not tested it.

Thank you!

Post count: 52

We are currently using php7 with this theme, seems to work. However php7 compatability checker finds a few errors.

What plans are the to make the theme fully comparable?

Post count: 22421

Our plans are to make the theme fully compatible. But this process takes a lot of time as there are major differences between the 2 php versions and we have to keep both the old version compatibility and the new version as well. That will be the main challenge. It will be much simpler if ALL users move to php 7 and then we will create our theme based on the new php 7 rules and be done with it, but unfortunately this will not happen anytime soon. There will still be users who use the old version.
Thank you for your understanding.

Post count: 21

I’m getting the same errors in my PHP Error Log but the only differences are I’m using PHP 5.6.9 and I had the default post template set to Style 8. As you can see below, my default template (single_template_8.php) is listed just as lethow’s default template (single.php) is listed in their code.

WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE AND comment_parent IN (3158,3159,3160,3164,3165,3178,3179,3183,3184,3190,' at line 1 for query SELECT wp_comments.comment_ID, wp_comments.comment_parent WHERE AND comment_parent IN (3158,3159,3160,3164,3165,3178,3179,3183,3184,3190,3224,3292,3323,3334,3383,3409) ORDER BY comment_date_gmt ASC, comment_ID ASC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Newspaper/single_template_8.php'), comments_template, WP_Comment_Query->__construct, WP_Comment_Query->query, WP_Comment_Query->get_comments, WP_Comment_Query->fill_descendants

Post count: 22421

Hello,

The error you are getting does not point to the theme. Please contact your host and let them know about the errors. It is a WordPress database error, not a theme error. Please make sure your wordpress is up and running properly with no errors before using the theme.

Thank you!

Post count: 52

The tagdiv team obviously have been adjusting the code over time and that is much appreciated.

If I understand correctly there are a core of php 7 / php 5.6 / php 5.5 / php 5.4 commands that work with all versions. I guess the tagdiv are avoiding using new commands added in php 7 and replacing commands that had been deleted (i.e. not supported). Ideally this would also includes commands that are deprecated but still present.

I did a quick check and found only 5 instances which could be classified as errors for php 7 (this nicely less than a 2015 version of the theme I looked at).

The speed improvements (double) and less resource requirements of php 7 are significant improvements. Any chance I could encourage a further review of the code?

Thanks.

Post count: 22421

Hi,

Thanks for understanding our struggle. We are looking into it but I cannot say how long it will take to implement. We just released a new update today so you might want to test this one as well 🙂
We are constantly looking to improve our theme to make it compatible with all the latest technologies but this takes time. We will make our theme compatible with php 7 there is no doubt about that, only the ETA is not yet set. We are still considering our options on how to go about it.

Thank you!

Post count: 52

I have checked over that latest version found only 5 instances which could be classified as errors for php 7.

Surely this would be worth looking at to be able to claim php7 ready!

Many other themes seem to now have managed this…

Viewing 12 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic.