Skip to content

Tag: wordpress

Get first image from last post in WordPress

Can’t get the first picture in the last post (function – get_first_post_image). Where is the mistake? Please help me. Thank you in advance for your help. Sorry for my bad English. Answer I’ve rewritten the function to return the default image if no first image is found. Best way of parsing H…

How to decrease file size upload for non-admin users?

My site allows upload file size of up to 256 MB but I would like to limit my site users to only 1 MB max and keep the maximum 256 MB for the admins. All solutions I found only show how to increase the upload limit, but not decrease for specific roles. I tried the following but it didn’t work:

PHP get_headers function always HTTP/1.1

The PHP get_headers function returns an array, eventually including a string like HTTP/1.1 200 OK. The URLs I pass to the function are https. For some reason the successful response of get_headers always has HTTP/1.1, but Firefox devtools – network tab says it’s HTTP/2. I call the function like $h…