Any Theme > Open Content.php > Find >
Open Content.php into your wordpress template
Find this code
<h1 class="entry-title"><?php the_title(); ?></h1>
Insert The Following Directly After
<h1 class="entry-title"><?php the_title(); ?></h1> :
this
<?php
$folder = opendir('/home/black/public_html/_wordpress/wp-content/images');
$i = 0;
while(false !=($file = readdir($folder))){
if($file != "." && $file != ".."){
$images[$i]= $file;
$i++;
}
}
$random_img=rand(0,count($images)-1);
echo '<img src="/wp-content/images/'.$images[$random_img].'" alt="" />';
?>
Save & close
Create a folder Images in /home/black/public_html/_wordpress/wp-content/images
Upload random images to the folder - (I have 900) Few seconds to scrape them - make them small 20kb to 80kb
create a bash script
nano rename_files.sh
insert the following:
a=1
for i in *.jpg; do
new=$(printf "image_%04d.jpg" "$a") #04 pad to length of 4
mv -- "$i" "$new"
let a=a+1
done
b=1
for i in *.gif; do
new=$(printf "image_%04d.gif" "$b") #04 pad to length of 4
mv -- "$i" "$new"
let b=b+1
done
c=1
for i in *.png; do
new=$(printf "image_%04d.png" "$c") #04 pad to length of 4
mv -- "$i" "$new"
let c=c+1
done
remember to chmod +x
run script with
./rename_files.sh
Now all your blogs for that template have random images. - Better serp scores