Link to resized media file

You can use the get_the_post_thumbnail_url explained here So, the code would be <a href=”https://wordpress.stackexchange.com/questions/279104/<?php echo get_the_post_thumbnail_url(get_the_ID, array (2000, 1500) ) ?>” >……. </a>

Media searching ignored

WordPress doesn’t search images by their file names. It performs a search based on Title. By default titles are generated automatically from file names, but it can be changed in editor by users.

wp-cli post create & media import issues

So I just ended up doing a query on the database for the link of the image: wp db query “SELECT guid FROM wp_posts WHERE ID=’ID_FROM_MEDIA_IMPORT’” –silent –skip-column-names I wrote this bash script for the whole process: post-create.sh PATH_TO_IMAGE.FILETYPE “TITLE” imageID=$(wp media import $1 –porcelain) imageLINK=$(wp db query “SELECT guid FROM wp_posts WHERE ID=’$imageID'” –silent … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)