Home User profile
tagDiv Member
Check out my web development site https://giacomolaw.me My blog is here: https://www.thenerdystudent.com
GiacomoLaw
tagDiv Member

Got the above working. Line 303:

/www/www/wp-content/plugins/td-composer/legacy/common/wp_booster/td_module_single_base.php

GiacomoLaw
tagDiv Member

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>';

}
}

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

No worries, that solution has just worked for my sites on Newspaper. Hope you manage to sort it out 🙂

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

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 😀

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

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/

GiacomoLaw
tagDiv Member

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');

GiacomoLaw
tagDiv Member

Hi there, does this still work for you? Applied it to my install and it didn’t work.

GiacomoLaw
tagDiv Member

Anyone managed to fix this?

GiacomoLaw
tagDiv Member

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

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

Sent, hope you manage to sort it out.

GiacomoLaw
tagDiv Member

Hi, I can send you the 9.7.3 child theme, just give me an email to send them too 🙂

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

Thanks, glad you like it. Spent days sorting out site speed lol.

GiacomoLaw
tagDiv Member

Updated to 9.7.2 and AMP works fine with the child theme now. Thanks for the fix!

GiacomoLaw
tagDiv Member

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.

GiacomoLaw
tagDiv Member

I only have those two files, style.css and functions.php in my chins theme anyway. The issue still occurs.

GiacomoLaw
tagDiv Member

I am having this too, seems to be an issue. Hopefully it will be fixed soon 🙂

GiacomoLaw
tagDiv Member

Worked, thanks! Now I just need to transfer my customisations over.

You are a lifesaver, thank you so much 🙂

Thank you!

GiacomoLaw
tagDiv Member

Great, thanks, I will try again.

Viewing 25 posts - 1 through 25 (of 166 total)