Got the above working. Line 303:
/www/www/wp-content/plugins/td-composer/legacy/common/wp_booster/td_module_single_base.php
Got it working:
else {
if (td_util::get_option('tds_p_show_date') != 'hide') {
global $wp_version;
//old WP support
if (version_compare($wp_version, '5.3', '<')) {
$td_article_date = date(DATE_W3C, get_the_modified_time('U', $this->post->ID));
} else {
// get_post_datetime() used from WP 5.3
$td_article_date = get_post_datetime($this->post->ID, 'date', 'gmt');
if ( $td_article_date !== false ) {
$td_article_date = $td_article_date->format(DATE_W3C);
}
}
$buffy .= '<span class="td-post-date" style="color:#aaa;">';
$buffy .= 'Last Updated: <time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_modified_time(get_option('date_format'), $this->post->ID) . '</time>';
$buffy .= '</span>';
}
}
Any chance you could reupload the screenshots? Having the same issue and the links to those shots no longer work.
Edit: Found this: https://www.screencast.com/t/RrqBvPFb3e
However it appears after the reshuffle of the files a while ago it is no longer in the wp_booster folder. Searching for where it is now.
-
This reply was modified 5 years by
GiacomoLaw.
No worries, that solution has just worked for my sites on Newspaper. Hope you manage to sort it out 🙂
Hi, thank you! The banner image takes you to the home page.
Just checked the homepage and the 6 – 10 images aren’t linking as I haven’t set them to link. Setting them to link in the media settings has fixed the issue.
I’m using this: https://github.com/GiacomoLaw/tagdiv-cdn-modal/blob/master/tagdiv-cdn-modal.php as I have a CDN, so I need to use that to fix it as Tagdiv haven’t allowed CDNs to be used with the modal.
Maybe try enabling opening the image in the new tab box? I have that and I think it only works on those.
Not really sure tbh, just got some of mine working.
Got a fix for this. Go to wp-includes/comment-template.php, and then to the function comments_template.
Under the first if function, insert this:
if ( is_preview() ) {
return;
}
Should look like this:
function comments_template( $file = '/comments.php', $separate_comments = false ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
if ( ! ( is_single() || is_page() || $withcomments ) || empty( $post ) ) {
return;
}
if ( is_preview() ) {
return;
}
Basically stops the function from running if it’s a post preview. Fixes it nicely.
Hope this helped! Be sure to update it every time there is a WP update 😀
My bad, turns out the files need to be linked like so: https://imgur.com/a/kcouZvg
Otherwise, the error occurs if the file isn’t linked.
Package it into a .php file, and either zip it and upload via WP Plugin area or upload it in a folder to your plugins folder.
Adding this to my functions.php file, or uploading it as a plugin worked for me:
// td modal img on all images
function add_responsive_class($content){
$content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
$document = new DOMDocument();
libxml_use_internal_errors(true);
$document->loadHTML(utf8_decode($content));
$imgs = $document->getElementsByTagName('img');
foreach ($imgs as $img) {
$existing_class = $img->getAttribute('class');
$img->setAttribute('class', "td-modal-image $existing_class");
}
$html = $document->saveHTML();
return $html;
}
add_filter('the_content', 'add_responsive_class');
Also lets you use modal images if you use a CDN like I do. Here is proof of working: https://www.thenerdystudent.com/2019/05/newspaper-speed/
Managed to get it working with:
// td modal img on all images
function add_responsive_class($content){
$content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
$document = new DOMDocument();
libxml_use_internal_errors(true);
$document->loadHTML(utf8_decode($content));
$imgs = $document->getElementsByTagName('img');
foreach ($imgs as $img) {
$existing_class = $img->getAttribute('class');
$img->setAttribute('class', "td-modal-image $existing_class");
}
$html = $document->saveHTML();
return $html;
}
add_filter('the_content', 'add_responsive_class');
Hi there, does this still work for you? Applied it to my install and it didn’t work.
Anyone managed to fix this?
Cloudflare is good for this, also means you don’t need to set up a minifying plugin and save speed. It’s also very easy to set up. I’ve saved 33% of loading time using this.
Autoptimize is also great, this may interest you in setting it up: https://www.thenerdystudent.com/2019/05/newspaper-speed/#autoptimize
Can second report 1, using the classic editor. In regards to report 2, it is recognizing the theme – it is saying it is getting it from the theme panel.
Sent, hope you manage to sort it out.
Hi, I can send you the 9.7.3 child theme, just give me an email to send them too 🙂
-
This reply was modified 7 years by
GiacomoLaw.
Let me know how it goes! All of that is implemented on my site so works fine, I also tried it all locally and it worked well on a fresh install.
Thanks, glad you like it. Spent days sorting out site speed lol.
Updated to 9.7.2 and AMP works fine with the child theme now. Thanks for the fix!
Worked for me, thank you very much!
Was on line 3949 for me however, but it’s the only line in the code so doesn’t really matter.
Appreciate the fix, thanks.
-
This reply was modified 7 years by
GiacomoLaw.
I only have those two files, style.css and functions.php in my chins theme anyway. The issue still occurs.
I am having this too, seems to be an issue. Hopefully it will be fixed soon 🙂
Worked, thanks! Now I just need to transfer my customisations over.
You are a lifesaver, thank you so much 🙂
Thank you!
-
This reply was modified 7 years by
GiacomoLaw.
Great, thanks, I will try again.