- 7 Tem 2013
- 8,196
- 659
You can add this function to the function.php file
and call it as where you want to show image <?php getImage(1′); ?> .. inside loop.
Kod:
function getImage($num) {
global $more;
$more = 1;
$link = get_permalink();
$content = get_the_content();
$count = substr_count($content,
$start = 0;
for($i=1;$i<=$count;$i++) {
$imgBeg = strpos($content, );
$postOutput = substr($post, 0, $imgEnd+1);
$postOutput = preg_replace(/width=([0-9]*) height=([0-9]*)/, /width=117″ height=68″/,$postOutput);
$postOutput = preg_replace(/alignright/, alignleft,$postOutput);
$image[$i] = $postOutput;
$start=$imgEnd+1;
}
if(stristr($image[$num],.$image[$num].; }
$more = 0;
}
and call it as where you want to show image <?php getImage(1′); ?> .. inside loop.