Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Append @2x to image eg @2x.jpg WordPress


Hi, I am trying to append '@2x' to the end of the second image of my srcset, I can do this easily with javascript, but was wondering if there is a way to in php?

Current code:

$project_thumbnail = rwmb_meta( 'meta_project_images', 'type=image&size=project-thumbnail');
foreach ( $project_thumbnail as $image ){

echo "<source srcset='{$image['url']}, {$image['url']} 2x' >\n";



What I am trying to generate:


<source srcset='featured-480x320.jpg, featured-480x320<strong>@2x</strong>.jpg 2x' >


Answers (0)

No answers yet.