php – wp_query – Exclude the first thumbnail from lazy loading on archives

I have a function that change loading=”lazy” to loading=”eager” from the first thumbnail in categories and tags.
The problem is that this function removes the post thumbnails from posts and pages.
I tried to conditionally exclude posts and pages with !is_single() && !is_page() but with no effect:

add_filter( 'wp_get_attachment_image_attributes', function( $attrs ) {
if ( !is_single() && !is_page() && is_front_page() && is_archive() && is_search() ) {
global $wp_query;

if ( $wp_query->current_post === 0 )
    $attrs('loading') = 'eager';
    return $attrs;
}

} );

web development – Sharing url link does not show thumbnail image on facebook but only title

I try to use FB Debug tools, it’s very useful information. It said support WebP image extension?

but the Question why some posting support ( this one showing )

this one show Image
https://www.eitren.com/life-video/not-give-up-with-highly-hope-save-this-dog-in-the-hard-situation-but

this one Title only
https://www.eitren.com/apps/hows-your-seo-brand-link-performance-in-serp-ranking

I’m still finding out the problem, but FB debug tools very useful

https://developers.facebook.com/tools/debug/

Thank you

File manager with exif thumbnail support?

I have a large number of photos stored on my NAS which I’d like to view (but not download) on my Android phone. At present I do so via SMB (Windows file share, but I am open to using another protocol) using CX File Explorer, but Cx File Explorer is very slow loading thumbnails of images.

To combat this, I have been researching Exif Thumbnails as a solution (as then a client only had to load the first couple of kilobytes of the image to access the thumbnail), but Cx File Explorer does not appear to support them: I set up 2 test folders: 1 with 50 pictures without exif thumbnails, and another with those same 50 pictures with thumbnails, but did not observe a difference in loading speed (whereas I did observe a difference when I did the same experiment with a Windows 10 client).

My question is this: Is there a file manager app that supports both previewing images on SMB shares and exif thumbnails?

Magento2 MultiStore Set Image as small, base and thumbnail programmaticaly not working

Requirement:- Upload multiple images from external url and mark them as thumbnail/small or swatch images. Using multi website, multi store.

Issue:- When i tried to do this by custom api in that case, those images are uploaded for both websites but the thumbnail/small/swatch are applied to only one store why.

What i tried:-

  1. created custom api.
  2. tried with setting current store to 0 (default)
  3. tried with loading product 2 times with different store id.

second store - not assigned swatch, thumbnail lable

first store

Custom API Payload:-

{
"media_gallery_entries":(
    {
        "label":"tiny1_new_label",
        "types":(
            "thumbnail"
        ),
        "file":"1.png"
    },
    {
        "label":"tiny1_new_label",
        "types":(
            "small_image"
        ),
        "file":"2.png"
    },
    {
        "label":"tiny1_new_label",
        "types":(
            "swatch_image",
            "image",
            "small_image",
            "thumbnail"
        ),
        "file":"3.png"
    }
)

}

API code:-

<?php

/**

  • Copyright © All rights reserved.
  • See COPYING.txt for license details.
    */
    declare(strict_types=1);

namespace ProductCustomApiModel;

use MagentoFrameworkExceptionInputException;
use MagentoFrameworkExceptionNoSuchEntityException;
use MagentoFrameworkAppRequestInterface;
use MagentoCatalogModelProduct;
Use TavantCustomApiHelperData;
use MagentoStoreModelStore;

class UpdateImage implements ProductCustomApiApiUpdateImageInterface
{
protected $request;

protected $product;

protected $customApiHelper;

protected $_productRepository;

protected $galleryReadHandler;

protected $productGallery;

protected $imageProcessor;

public function __construct(

    MagentoFrameworkWebapiRestRequest $request,
    MagentoCatalogModelProductRepository $productRepository,
    MagentoCatalogModelProductGalleryReadHandler $galleryReadHandler,
    MagentoCatalogModelProductGalleryProcessor $imageProcessor,
    MagentoCatalogModelResourceModelProductGallery $productGallery,
    Product $product,
    Data $customApiHelper
){

    $this->request = $request;
    $this->product = $product;
    $this->_productRepository = $productRepository;
    $this->customApiHelper = $customApiHelper;
    $this->galleryReadHandler = $galleryReadHandler;
    $this->productGallery = $productGallery;
    $this->imageProcessor = $imageProcessor;

}


/**
 * {@inheritdoc}
 */
public function postUpdate()
{
    $post= $this->request->getPost();
    
    $response('status') = 200;
    $response('message') = '';
    $logInfo = ();

    $post = $this->request->getContent();
    
    if(empty($post)){
        $this->returnResponse(400, 'Please provide product information');
    }

    $data = json_decode($post);
    $data = (array) $data;

    $media_gallery_entries = array();
    if(isset($data('media_gallery_entries'))){
        $media_gallery_entries =  (array) $data('media_gallery_entries');
    }
    
    try {
        $productSku = $this->request->getParam('sku');
        $product = $this->_productRepository->get($productSku);

        if (!empty($product)) {
            
            $this->galleryReadHandler->execute($product);

            // Unset existing images
            $images = $product->getMediaGalleryImages();
            foreach($images as $child) {
                $this->productGallery->deleteGallery($child->getValueId());
                $this->imageProcessor->removeImage($product, $child->getFile());
            }

            /**
             * Add image. Image directory must be in ROOT/pub/media for addImageToMediaGallery() method to work
             */
            $this->customApiHelper->checkIfTmpDirExist('new');

            if(count($media_gallery_entries) && !empty($media_gallery_entries)){
                foreach($media_gallery_entries as $child) {
                    $imageData = (array) $child;
                    if($this->customApiHelper->checkIfImgExistInNewDir($imageData('file'))){
                        $product->addImageToMediaGallery('new' . DIRECTORY_SEPARATOR . $imageData('file'), $imageData('types'), true, false);
                    }else{
                        $logInfo() = $imageData('file') . ' not exist in folder';
                    }
                }
            }
            $product->save();
            $this->returnResponse(200, 'media images for product updated', $logInfo);
        }else{
            $this->returnResponse(400, 'product not found');
        }
    } catch (Exception $e) {
        $this->returnResponse(400, $e->getMessage());
    }

    $this->returnResponse(400, 'unexpected return, check admin');
}

protected function returnResponse($statusCode = 200, $message, $logInfo = ())
{
    $post = $this->request->getContent();
    $data = json_decode($post);
    $requestData = (array) $data;
    $productSku = $this->request->getParam('sku');
    
    $statusCode = ($statusCode == 200) ? 'success' : 'failed';
    $response('result') = $statusCode;
    $response('message') = $message;
    $response('log_info') = $logInfo;
    $response('request_date_time') = $requestDateTime = time();

    $this->customApiHelper->writeIntoCustomLog('product-image', $productSku, $requestData, $response, $requestDateTime);

    echo json_encode($response);die;
}

}

seo – Google Mobile not displaying thumbnail

Why Google Mobile Search does not display thumbnail for websites even if schema.org, meta tags and OpenGraph tags are all correct and follows SEO best-practice? As you can see from the following example (Official Website result) https://www.google.it/search?q=brand+new+heroes. The page is filled with opengraph tags, json+ld schema, main image is placed above the fold and wrapped inside h1 tag with alt proprety correctly set.

Buying – Youtube Thumbnail Designs

Hey there,

I need to create multiple crypto related thumbnail designs. Paying $6 per thumbnail I end up buying. Will be accepting multiple designers for the thumbnail and will only buy the ones that I end up taking. With that said, will need multiple and your free to revise and submit multiple designs.
SEMrush

If you are interested. PM Me your skype and I’ll provide more details.

 

sharepoint online – How to View Visio Thumbnail using getpreview.ashx?

Is there any way to preview the visio document in Sharepoint Online.

I have tried using the below url

https://{tenant}.sharepoint.com/_layouts/15/getpreview.ashx?path={pathToTheDocument}

but can’t view the preview of visio. Is there any way to preview the visio in SharePoint online?

Any help would be appreciated. Thanks in advance!

magento2 – magento product thumbnail image cache issue

Magento 2 thumbnail main image cache path link changed from this link on the home page after 2 days
pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

to this

media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

because of that, I am getting this

but when do flush Magento cache it changes back to

pub/media/catalog/product/cache/be293bf7411b924394287949fb9084eb/b/e/be-in-in.png

please can anyone give me suggestion to solve this issue?

thanks

sharepoint online – Highlighted Content Webpart Thumbnail Picture – Classic SC as source

I’m struggling with a new Highlighted Content web part in a modern page and would love to hear back on your experience.

The scenario we have is a mixed online tenant with both classic and modern site collections, hubs etc. In this particular use case I want to display the content of a “News” List (custom list) on a modern page. The list is located in the classic site collection, has some custom columns to it, including Pictures.

I have used Highlighted Content web part and it does 90% of the job well. I query the content type id from classic site and retrieve the results, but the thumbnail picture stays empty.

I have tried so far the following without success:

  • adding both Hyperlink or Picture and Image Columns to the classic list
  • naming the columns the same way modern Pages Library has its Thumbnail Picture column (site column) named – “Banner Image URL”
  • querying the List in the same (modern) SC with both tests above

The HC WP just doesn’t seem to get that picture thumbnail, which is quite frustrating.

Side note: We want to stick to standard SharePoint and avoid custom developments as much as possible.

Does anyone managed to use this web part with picture displayed on the content in the lists? Both classic and modern?

Thumbnail is showing outside its div instead of inside it

I’m echoing the post thumbnail here:

echo '<div class="post-image right">' . the_post_thumbnail('featured-portrait-large') . '</div>';

And it works, but it’s outputting the image outside the div like this:

<div class="post-header-text">
  <img width="500" height="700" src="(IMAGE URL DELETED)" class="attachment-featured-portrait-large size-featured-portrait-large wp-post-image" alt="" loading="lazy">
  <div class="post-image right"></div>
</div>

What I want is:

<div class="post-header-text">
  <div class="post-image right">
    <img width="500" height="700" src="(IMAGE URL DELETED)" class="attachment-featured-portrait-large size-featured-portrait-large wp-post-image" alt="" loading="lazy">
  </div>
</div>

Could someone explain why and what I’ve done wrong?