Buy me a coffee

Change order of Text – Image on Mobile

Suppose we have these text/images.

Change Order Of Text Image On Mobile 1 Min

On mobile, you want to move image to this position

Change Order Of Text Image On Mobile 2 Min

#1. Edit Image > Add this word into ALT
mobileimg

Change Order Of Text Image On Mobile 3 Min

#2. Edit Text > Add this hyperlink after text.
mobiletext
Make sure “Open in New Tab” is disabled.

Change Order Of Text Image On Mobile 4 Min

we will have this

Change Order Of Text Image On Mobile 5 Min

#3. Use this code to Custom CSS box to make “mobile-text” invisible

a[href="#mobile-text"] {
    display: none;
}

Change Order Of Text Image On Mobile 6 Min

#4. Use this code to Code Injection > Footer (or Page Header Injection) to move image to desired position.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($) {
function run() {
    if ($(window).width() <= 767) {
$('div.image-block [alt*="mobileimg"]').insertAfter('div.html-block:has(a[href="#mobile-text"])');
} else {

}
}
    run();
    window.addEventListener('resize', run)
});
</script>

Change Order Of Text Image On Mobile 7 Min

#5. Result

Change Order Of Text Image On Mobile 8 Min