No search results were found in Documentation!
Thank you for bringing this up! I’ve been trying to figure out how to Preload the homepage featured images along with the article featured image only. Google is really focusing on these aspects, and I had assumed the theme would be updated with this in mind.
I did find this code for preloading featured images and wanted to let the Newspaper developer see if it would work with this one.
It would be great to have this figured out before May hits with Google’s changes.
Thank you.
/**
* Preload attachment image, defaults to post thumbnail
*/
function preload_post_thumbnail() {
global $post;
/** Prevent preloading for specific content types or post types */
if ( ! is_singular() ) {
return;
}
/** Adjust image size based on post type or other factor. */
$image_size = 'full';
if ( is_singular( 'product' ) ) {
$image_size = 'woocommerce_single';
} else if ( is_singular( 'post' ) ) {
$image_size = 'large';
}
$image_size = apply_filters( 'preload_post_thumbnail_image_size', $image_size, $post );
/** Get post thumbnail if an attachment ID isn't specified. */
$thumbnail_id = apply_filters( 'preload_post_thumbnail_id', get_post_thumbnail_id( $post->ID ), $post );
/** Get the image */
$image = wp_get_attachment_image_src( $thumbnail_id, $image_size );
$src = '';
$additional_attr_array = array();
$additional_attr = '';
if ( $image ) {
list( $src, $width, $height ) = $image;
/**
* The following code which generates the srcset is plucked straight
* out of wp_get_attachment_image() for consistency as it's important
* that the output matches otherwise the preloading could become ineffective.
*/
$image_meta = wp_get_attachment_metadata( $thumbnail_id );
if ( is_array( $image_meta ) ) {
$size_array = array( absint( $width ), absint( $height ) );
$srcset = wp_calculate_image_srcset( $size_array, $src, $image_meta, $thumbnail_id );
$sizes = wp_calculate_image_sizes( $size_array, $src, $image_meta, $thumbnail_id );
if ( $srcset && ( $sizes || ! empty( $attr['sizes'] ) ) ) {
$additional_attr_array['imagesrcset'] = $srcset;
if ( empty( $attr['sizes'] ) ) {
$additional_attr_array['imagesizes'] = $sizes;
}
}
}
foreach ( $additional_attr_array as $name => $value ) {
$additional_attr .= "$name=" . '"' . $value . '" ';
}
} else {
/** Early exit if no image is found. */
return;
}
/** Output the link HTML tag */
printf( '<link rel="preload" as="image" href="%s" %s/>', esc_url( $src ), $additional_attr );
}
add_action( 'wp_head', 'preload_post_thumbnail' );
Hi,
How can I adjust the boxed layout width to 1200px and with an inner padding of 30px similar to the mockup image linked to below. I would like to adjust the header, content, and footer zones.
Thank you!
Mockup: https://i.imgur.com/yImVThs.png
Sizes are based off ColorMag theme: https://themegrilldemos.com/colormag/
Hello @tuedung!
First of all upload the images in full size.
Please make sure that you have activated the proper thumbs.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello!
The images are cropped automatically for the blocks, that’s why you can disable the thumbs you are not using. Set up your thumbs from Newspaper -> Theme panel -> Block settings -> Thumbs on modules/blocks. If you deactivate a dimension from there, next time when you will upload an image, it will not be resized to that dimension.
After changing the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
You can not use those custom sizes from WordPress, unless you modify the way the blocks work.
Thank you!
Hi,
I am checking settings for flex block 1. In the layout tab and article image section in the image size dropdown I see only thumbnail sizes defined on the newspaper theme panel.
I do not see thumbnail sizes from wordpress standard Settings->Media page. Does it mean I should set all of those standard wordpress to 0 so that they are not generated? As anyway I cannot use them? That would save some hosting space.
I wanted to create 500px no crop thumbnail for my project as the standard Newspaper medium default size (696px) is too big for me and others are too small (300px). Is there a way to do it?
Thanks!
Hello!
First of all upload the images in full size.
Please make sure that you have activated the proper thumbs.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello!
First of all upload the images in full size.
Please make sure that you have activated the proper thumbs.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello !
Please note that the recommended featured image size is 800x600px or 1920x1080px. You can use the tagDiv Composer in the Mobile Viewport and set your thumb sizes as you can see here: https://www.screencast.com/t/CJUsauI9KSd
Thank you !
Hello!
Please note that the element “Single Post Bg Featured Image” don’t have the setting to display the caption, this option has only the “Single Post Featured Image”:
https://www.screencast.com/t/poYC47fe;
https://www.screencast.com/t/CtgupYpJ0
The differences between BG featured image and single post featured image:
– the description (capture) will not appear in BG
– the image size you can set only in BG, so in a single post featured image will take the image in original sizes
– more options for styling in a single post featured image than BG
Thank you!
Hello,
We insert images on pages but they are uploaded as min 1200px height and min 800px width. As example 1275 by 850 pixels.
When you view the image on a page yes it will be resized to fit but for AMP / Google all image must be the correct size for it’s intrinsic value. Newspaper theme makes the intrinsic on that image (and all others) 1024px wide by 683px height.
Wordpress media sizes increased beyond the sizes by far like large format 2500px and still it generates 1024px X 683px images for intrinsic. If I view the image in the Media library it is the correct size but when I view where it was added on the page and inspect the intrinsic is 1024px X 683px.
Please help me fix this as we need the larger intrinsic active.
Hi,
I have set the value to zero in the settings of the media library however I can see many multiple sizes for the all the images in my WP Content uploads folder. Also I have noticed that even though when I delete images from the uploads, they keep coming back again.
Hi!
Featured image shows sifferent sizes in some posts.
Here is normal: https://costadelsol-online.es/malaga-tdk/
But here is smaller: https://costadelsol-online.es/a380-in-malaga/
Original images have larger sizes, so we don´t know why have been cropped in the last article.
Thanks.
Hello,
Please make sure that you have activated the proper thumbs for the mobile theme. The mobile theme requires the “265×198” and the “741×486” thumbnail sizes in order to show the featured images properly.
This can be found here: https://www.screencast.com/t/N18dR3qZrh
The ad box has 3 sections for ads: using theme panel ads -> https://i.imgur.com/KFa9ibl.png, using images/banners -> https://i.imgur.com/MfAPTaE.png and custom code -> https://i.imgur.com/2rh8SuD.png save it and will appear on the post (you can set a shortcode like a shortcode from adrotate plugin or other plugins)
Thank you!
Hello,
Unfortunately, the element “Single Post Bg Featured Image” don’t have the setting to display the caption, this option has only the “Single Post Featured Image”. => https://www.screencast.com/t/poYC47fe -> https://www.screencast.com/t/CtgupYpJ0
The differences between BG featured image and single post featured image:
– the description (capture) will not appear in BG
– the image size you can set only in BG, so in a single post featured image will take the image in original sizes
– more options for styling in a single post featured image than BG
Thank you!
Hi,
Nice site.
Have a look at the Page Speed Insights.
I would start with your image sizes, which need compressing. There are some great plugins that will do this for you in wWordpress.
I have had success with EWWW Image Optimizer (Free).
Ant
Hello!
If you have a responsive version, then please edit the page with TagDiv Composer, click on the mobile viewport: https://www.screencast.com/t/XDQJedlggSB and check if the images have the right sizes set up in the element’s settings.
Thank you!
Hello,
Unfortunately, the element “Single Post Bg Featured Image” don’t have the setting to display the caption, this option has only the “Single Post Featured Image”.
The differences between BG featured image and single post featured image:
– the description (capture) will not appear in BG
– the image size you can set only in BG, so in a single post featured image will take the image in original sizes
– more options for styling in a single post featured image than BG
Thank you!
I tried:
.td-container.td-post-template-default {
max-width: 1200px;
width: 100%;
}
And my blockposts became 1200 px wide but it messed up the responsiveness.
It looks like this on some window sizes:
Where it looked like this without the code:
So I tried this:
@media screen and min-width(800px) {
.td-container.td-post-template-default {
max-width: 1200px;
width: 100%;
}
}
But somehow it does not change the width?
To fix the sidebars imagesize I did this:
.td_module_1 > div:nth-child(1) > div:nth-child(1) > a:nth-child(1) > img:nth-child(1) {
full-width: 100%;
width: 100%;
}
And it works.
To make all images on blockposts full width I did this:
img {
width: 100;
}
And it works.
How come this code doesn’t change the width?
@media screen and min-width(800px) {
.td-container.td-post-template-default {
max-width: 1200px;
width: 100%;
}
}
Thanks!
-
This reply was modified 5 years by
benjaone1.
Hello!
Please make sure that you have activated the proper thumbs in order to show the featured images properly.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello !
Please make sure that you have activated the proper thumbs for the mobile theme. The mobile theme requires the “265×198” and the “741×486” thumbnail sizes in order to show the featured images properly.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you !
Hello!
In this image it seems like Mobile Theme and on your website like in your expected output image.
If you created the mobile pages with TagDiv Composer, then when you install Mobile Theme plugin, your pages will be overwritten by the plugin.
The Mobile Theme is a performance optimized theme included in the Newspaper main theme and it loads only for mobile devices. It comes with its own templates for page, post, category, etc so your current templates from the desktop theme will get converted to the mobile theme layout. For more details, please take a look here: https://forum.tagdiv.com/the-mobile-theme/
Please make sure that you have activated the proper thumbs in order to show the featured images properly.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello!
Unfortunately, in our theme you can not edit the images like in Photoshop for example.
They are cropped automatically: https://forum.tagdiv.com/featured-image/ ; that’s why you can disable the thumbs you are not using. Set up your thumbs from Newspaper -> Theme panel -> Block settings -> Thumbs on modules/blocks. If you deactivate a dimension from there, next time when you will upload an image, it will not be resized to that dimension.
After changing the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Please give me a screenshot where exactly the issue is, so I can take a closer look into your issue.
That counter you can add wherever you want in the post if you have a cloud template assign for posts. But, for example, you can not split the icons from the counter.
Thank you!
Hello!
The images are cropped automatically for the blocks, that’s why you can disable the thumbs you are not using. Set up your thumbs from Newspaper -> Theme panel -> Block settings -> Thumbs on modules/blocks. If you deactivate a dimension from there, next time when you will upload an image, it will not be resized to that dimension.
After changing the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!
Hello!
Please make sure that you have activated the proper thumbs in order to show the featured images properly.
This can be found in here: https://www.screencast.com/t/N18dR3qZrh
After activating the thumbnail sizes you need to regenerate your thumbnails using a plugin. Check this: https://forum.tagdiv.com/using-the-theme-with-existing-content/
Thank you!