How to change Gallery image url in product page ? In function.php?

My code is like

add_filter('wp_get_attachment_url', function($  url){     if(strstr($  _SERVER['HTTP_ACCEPT'], 'image/webp')!=false){         return $  url.".webp";     }else{         return $  url;     } }); 

But only the last image in Gallery changed to xxx.webp . I want to know how to change other image ….I want all of them changed to xxx.webp

I dont want use a plugin (Or if i have to …),Please HELP ,Thanks .

how to display image in custom post type from frontend form using advanced custom field?

here is my code: employeedetails.php

<div class="container submit-message">     <h1>Employee Form</h1>     <form id="enquiry_email_form" action="#" method="POST" data-url="<?php echo admin_url('admin-ajax.php'); ?>" enctype="multipart/form-data">     <div class="form-group">             <label for="">Enter Title</label>             <input type="text" class="form-control" name="title" id="title"/>         </div>         <div class="form-group">             <label for="">Enter Description</label>             <input type="text" class="form-control" name="description" id="description"/>         </div>         <div class="form-group">             <label for="">Enter Your Name</label>             <input type="text" class="form-control" name="post_name" id="post_name"/>         </div>         <div class="form-group">             <label for="">Enter Your Designation</label>             <input type="text" name="post_designation" id="post_designation" class="form-control"/>         </div>         <div class="form-group">             <label for="">Salary</label>             <input type="text" class="form-control" name="post_salary" id="post_salary"/>         </div>         <div class="form-group">             <label for="">Enter Joining Date</label>             <input type="date" class="form-control" name="post_date" value="<?php echo date('Y-m-d'); ?>" id="post_date"/>         </div>            <div class="form-group">             <label for="">Select Image</label>             <input type="file" id="post_img" name="post_img" src="<?php bloginfo('template_url'); ?>" value="" accept="image/*""/>         </div>         <div class="form-group">             <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> Submit</button>         </div>     </form> </div> 

$ (document).ready(function() { $ (“#enquiry_email_form”).on(“submit”,function(event){ event.preventDefault(); /* Clear result div $ (“#data”).html(”); */ var form= $ (this); var ajaxurl =“”); // var image = $ (‘#post_img’).prop(‘files’)[0]; var post_title = form.find(“#title”).val(); var post_description = form.find(“#description”).val(); var post_name = form.find(“#post_name”).val(); var post_designation = form.find(“#post_designation”).val(); var post_salary = form.find(“#post_salary”).val(); var post_date = form.find(“#post_date”).val(); var post_img = form.find(“#post_img”).val(); /*console.log(post_title); console.log(post_description); console.log(post_name); console.log(post_designation); console.log(post_salary); console.log(post_date); console.log(post_img);*/ /*if(detail_info.post_title === “” || detail_info.post_description === “” || detail_info.post_designation === “” || detail_info.post_salary === “” || detail_info.post_date === “” || detail_info.post_img === “”) { alert(“Fields cannot be blank”); return; }*/ $ (“.btn btn-primary”).text(‘submitting…’); $ .ajax({ url: “/wp-admin/admin-ajax.php”, type: ‘POST’, data: { action: ‘save_post_details_form_employee’, // this is going to be used inside wordpress functions.php post_title : post_title, post_description : post_description, post_name : post_name, post_designation : post_designation, post_salary : post_salary, post_date : post_date, post_img : post_img }, success: function(data) { //alert(“Insert Success”); //console.log(data); // Show successfully for submit message $ (“.submit-message”).html(‘Thank you for submitting’); } }); }); });

Google uses wrong image to display product in Google Image Search

I have a problem with Google associating the wrong image with our products when they are display in Image Search.

For some reason, the main image of our products, which has more desirable data (alt tags, higher resolution, placed first as product image, not tampered with), is discarded.Instead, Google chooses the last loaded image for a product, which has no alt data, worse resolution, watermark dynamically added (it’s not even .jpg), or just blank white image with the watermark.

I have microdata set up dynamically for each product. I’ve removed the "additional_image" tag, using only "image", still no success.

Image Gallery – Click Button to Show Image

I’m working on an Image Gallery with buttons to show images with an [X] in the upper right corner to close the image. While the image is displayed the screen will not be darkened, but will be frozen from clicking anything except for the [X] to close the image. In the attached code there’s a call to a CustomFunction, which is where I really need help. All of the images will be smaller that 500 x 500 pixels and will be displayed in the center of the screen. I’m hoping there’s a way to use…

Image Gallery – Click Button to Show Image

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

this one Title only

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

Thank you

I need a game over(UI image) to appear after timer reaches 0

So here is my timer script that works fine. I need it to activate the game over(UI image ) when the timer reaches 0.I tried attaching a game over script to the UI image ( GOS script)….. no luck

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;

public class Timer : MonoBehaviour { public Text gametimer; public float timeLeft; public GameObject Gameover; public Text gameovertext;

// Start is called before the first frame update void Start() {       }  // Update is called once per frame void Update() {     if (timeLeft > 0)      {         timeLeft -= Time.deltaTime;     }     else      {         timeLeft = 0;      }      displaytime(timeLeft);  } void displaytime(float timeToDisplay) {     if (timeToDisplay < 0)     {         timeToDisplay = 0;         Debug.Log("Game Ova YOung!!!");              }          float minutes = Mathf.FloorToInt(timeToDisplay / 60);     float seconds = Mathf.FloorToInt(timeToDisplay % 60);      gametimer.text = string.Format("{0:00}:{1:00}", minutes, seconds); }            } 

//////// Game over screen script below

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class GOS : MonoBehaviour { GameObject GameOverScreen; public Timer timer;

// Start is called before the first frame update void Start() {     timer = GetComponent<Timer>();     GameOverScreen.SetActive(false); }  // Update is called once per frame void Update() 

{ if (timer = null) { GameOverScreen.SetActive(true); }



Setting fallback (default) image to featured image block

I was trying to make a block based theme and encountered a problem trying to set a default featured image in case some posts do not have them.

Basically, we used to do this in php

<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> 

But now with blocks, themes are html and all I can see is

<!-- wp:post-featured-image {"isLink":true} /--> 

I couldn’t find any other parameters here nor an if/else block so I could just add a plain html.

If anyone has done this, that would be of great help.