I heavily customized the AMP theme (by modifying the template in the plugin) to fit the style of my site, so I would have to redo everything with the 9.5 update since it no longer uses the TagDiv AMP plugin.
Also, I’m not a huge fan of the “mobile theme” because it conflicts with my server’s caching system and causes errors on the frontend. I also hate the mobile theme’s homepage because my site doesn’t use the traditional “blog” setup on the front page and I would like for my mobile site to reflect that as well.
No problem, glad I could help! I was testing 9.6 on my staging server and ran into the same issue. Took me about an hour of troubleshooting before I figured out how to fix it lol.
Are you using a child theme? If so, make sure you copy over the “header.php” file from the parent theme and replace the one in your child theme with it.
I have to agree … this new AMP setup is awful. I was excited to upgrade to 9.6 to make use of the new “header layout” feature, but once I realized that I had to rebuild my AMP pages all over again (and also be forced to use the mobile theme) I decided to downgrade back to the old version for the time being.
It’s a good thing I always back up my old theme before upgrading!
I had the same issue when I first installed the new theme. I disabled ALL of my plugins and then reactivated them, and somehow that fixed it. Hope that helps!
I came across this thread because I was looking for the same solution.
I have a set of categories I would like to “hide” from showing on posts (via theme settings), including the “Featured” category, and I noticed that these categories were being shown on AMP pages.
The solution is VERY easy.
Modify the “single.php” file under plugins > td-amp > templates:
Where it says:
<?php require_once('categories.php'); ?>
Replace that with:
<?php echo $td_mod_single->get_category(); ?>
Be aware that this will affect your CSS settings, so make sure you change “post-categories” to “td-category” in your CSS. And voila!
Hi Bogdan,
At this point, we’re getting so much traffic that the WP Super Cache plugin can’t handle it, so we’ve had to move to serverside caching, where everything is handled on the server before being sent to WP. I tried using WP Super Cache plugin but with us getting anywhere from 10,000 – 20,000 pageviews PER HOUR at the moment, it just can’t handle the load. So we have NO CHOICE but to use serverside caching.
I say all of this to say, that “fix” unfortunately won’t work for me because I’m currently not utilizing WP Super Cache. Also, I’m not using the latest version of WP — I’m on 4.5.3 because I tend to wait until all bugs are worked out before upgrading. I upgraded to the latest version the day it came out one time and it took my site down for an entire week because of ONE line of bad code from WP developers.
So is there anything else I can do to make sure mobile pages load on EVERY page load?
– Dustin
Hi RochdaleHerald,
For us, this happens whether anyone is logged in or not. Very annoying. Glad to know we’re not alone with this particular issue though. I tried to search for threads before posting this and didn’t come across anything so I was beginning to worry that we were the only ones having these problems.
– Dustin
Hi Bogdan,
I have disabled every single plugin (except Visual Composer) and the post settings still don’t show up for non-admins. If possible, I can send you login credentials to our “staging” site so that you can see for yourself.
Thanks for the update, glad to hear you guys plan on making updates to the post, homepage and smart templates.
Our responsive mobile site was slow, clunky, cluttered and FULL of those nasty ads that redirect you off the page and sends you to the app store, Google Play store or some weird, unobscure blank page. The mobile theme takes care of ALL of that, so overall, I’m happy, and our readers are happy that they can finally view our content on smartphones 🙂
Thanks again, and looking forward to the updates. Keep up the great work!
Chris,
I only come here when I have questions, and I see you replying to people a lot, so I just assumed you were a part of the TagDiv crew. My apologies! You must get that a lot because I clicked on your profile and I see that you have “I *do not* work for TagDiv” written in your bio.
I tried playing around with the code before coming here and asking questions, but I didn’t have any luck. I’ll just keep messing around and see what happens.
Chris,
Okay, so I’ve customized our AMP theme using the default plugin. Now I’m back to trying to make sure our video posts show up properly.
After going through the theme files, I came across this:
//handle video post format
if (get_post_format($this->post->ID) == 'video') {
//if it's a video post...
$td_post_video = get_post_meta($this->post->ID, 'td_post_video', true);
$td_video_support = new td_video_support();
//render the video if the post has a video in the featured video section of the post
if (!empty($td_post_video['td_video'])) {
return $td_video_support->renderVideo($td_post_video['td_video']);
}
This looks like what I need. It’s basically saying, “If this is a video post, render the video if the post has a video in the featured video section of the post.”
Now, what do I do with it?
Any help is much appreciated, thanks!
Chris,
Thank you for the info! I’ve disabled the PageFrog plugin and now my headache has been relieved. You are absolutely correct. The default plugin by WordPress/Automattic is much better! I like the fact that you can branch it off of your child theme, which makes using custom functions (which is exactly what I’m trying to do) foolproof. I’m just going to customize my own theme and see how things go from there.
As for your workload, more power to you. You guys do fantastic work around here so I’m sure whatever you’re cooking up will be great. Honestly, seeing that makes my issue seem a lot more manageable, haha.
I am still interested in working with you guys at some point in the future though (maybe later in the year when you’re free?) because I have a lot of custom work I want done to our theme. I’ll reach out at later time regarding that.
Good luck with the CMS rebuild and thanks for the help/info!
– Dustin
Hi Chris,
I’m familiar with how to modify theme files, however I have no idea where to start with this one, ha.
The way the particular plugin I’m using for AMP handles theme files is a little different, so you would probably have to take a look at that. Do you guys do custom work? If so, would it be possible to get a quote from you, privately? What is the best e-mail to reach you at? Or is there a way to send private messages through this forum?
Let me know as soon as you can, thanks!
– Dustin
Hi Andrei,
I tried all that before creating this thread and nothing worked. This is the error I’m seeing in Chrome’s javascript browser console:

Also, most of those errors you’re seeing are likely coming from ads/3rd party javascript. And to reiterate, the “load more” button and infinite loading work fine on our homepage, but it doesn’t work at all on post pages.
That did it, Emil, thanks!!!
Yeah, that’s the file I edited the first time, and it didn’t work for me. This time I edited the file directly from the server (instead of on my local machine first) and that still didn’t work.

I’m no longer getting a modal lightbox when I click on an image in an embedded gallery, but now when I click on the image, it goes to the JPG instead of the attachment page.
It’s like something in the theme is forcing our galleries to link to the media file instead of the attachment page. Do I need to remove the other lines of code from the booster functions file as well?
See here:
http://gossiponthis.com/2015/05/21/usher-bobby-v-others-clubbing-cirque-atlanta-photos/
ALSO, just so you know, ALL OF OUR GALLERIES are set to link the thumbs to the attachment page and NOT the media file.

Hi Alin,
Do I just remove the highlighted portion? I noticed that the line “jQuery(document).ready(function() {” line was not highlighted. The reason I’m asking is because I just removed what you highlighted and I’m still getting the lightbox on my galleries.
Example: http://gossiponthis.com/2015/05/21/usher-bobby-v-others-clubbing-cirque-atlanta-photos/
Just to update you all, in case anyone else is having this issue … it was the “popular over 7 days” widget we were using in the sidebar that was taking the site down whenever we have traffic spikes. I haven’t experienced any issues since removing that particular widget.
With it, we can barely handle 1k-2k pageviews an hour, but after removing the widget, one day we were experiencing a traffic spike and were able to serve about 8,000 pageviews per hour with ZERO issues.
This is what my host sent me:
Your server’s issue is that there are some very inefficient SELECT queries and was exacerbated by a crashed table. The crashed tables have now been repaired and fragmented tables have been optimized but the inefficient queries need to be addressed.
Regarding the SELECT statement on wp_posts, the query being run (see below) involves the tmp table. This is a very ‘expensive’ query, cause it involves writing the data to a location on disk, which is I/O intensive and imposes a high load on the server. Unfortunately, these queries could be related to wordpress stats/metrics/data collection/plugin/themes. The quick and dirty fix is to put the tmp tables in RAM for cases where there’s excess ram on the server, which your server unfortunately does not. Identifying the plugin/theme/etc that’s causing the proper way to go.
Copying to tmp table |
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND wp_posts.post_type = ‘post’ AND ((wp_posts.post_status = ‘publish’)) AND ( wp_postmeta.meta_key = ‘post_views_count_7_day_total’ ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC LIMIT 0, 5
The bolded portion is where the problem lies, which looks like it’s coming from the view counter. Is there a better way to optimize the code or should I just disable that portion of the theme altogether? I particularly enjoy showing articles that are trending so I’m hoping someone has a solution other than turning it off.
I tried installing the td speed booster plugin but I didn’t like how the front-end showed a “flash of unstyled content” so I disabled it.
Regardless though, this issue isn’t regarding the time it takes for the page to load in the browser, but rather the time it takes for my server to actually load the theme/template. I use New Relic and I’m noticing a major problem is coming from the database — specifically a process called “wp_posts – SELECT.”


I’ve been doing some research on this and I realized I’m using a “child theme” to modify random parts of the template. Could that be causing this issue with the database?
Thanks for the fast response Chris! Your explanation on the “popular posts” over the past 7 days thing makes sense.
Also, I don’t think WP Popular Posts – https://wordpress.org/plugins/wordpress-popular-posts/ — uses custom user fields to store their data. I think the data is stored in a MySQL DB so I’ll likely need to pay someone to “import” the old views.
Again, thanks!
Marius, thanks so much! That worked perfectly.
I’ve been looking for a solution to this for several days now. I knew I should have just used the support forum first, haha.
Thanks again!
You’ll need to create a child theme and then edit the “loop-single.php” file. If you’re familiar with coding, this should be a piece of cake, but if not, you might need to get someone else to look at it.
Documentation: https://forum.tagdiv.com/child-theme-documentation/