Hallo,
ich habe bei Monika auf der Seite dazu einen ineressanten Beitrag gefungen, in dem erklärt wird wie man das bewerkstelligt.
man nimmt sich die functions.php und setzt da folgenden Code ein:
Code
function the_image($size = 'medium' , $class = ''){
global $post;
//setup the attachment array
$att_array = array(
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order_by' => 'menu_order'
);
//get the post attachments
$attachments = get_children($att_array);
//make sure there are attachments
if (is_array($attachments)){
//loop through them
foreach($attachments as $att){
//find the one we want based on its characteristics
if ( $att->menu_order == 0){
$image_src_array = wp_get_attachment_image_src($att->ID, $size);
//get url - 1 and 2 are the x and y dimensions
$url = $image_src_array[0];
$caption = $att->post_excerpt;
$image_html = '<img src="http://www.texto.de/" alt="%s" class="%s" />';
//combine the data
$html = sprintf($image_html,$url,$caption,$class);
[COLOR=#666666][I]//echo the result[/I][/COLOR]
[COLOR=#B1B100]echo[/COLOR] [COLOR=#000088]$html[/COLOR][COLOR=#339933];[/COLOR]
[COLOR=#009900]}[/COLOR]
[COLOR=#009900]}[/COLOR]
[COLOR=#009900]}[/COLOR]
Alles anzeigen
[COLOR=#009900][/COLOR]
nun noch fix im template
und fertig.
Klappt auch soweit ganz gut, zumindest in meinem ersten Sticky post.
In allen anderen Posts auf der Startseite sehe ich leider kein Bild.
Weiß zufällig jemand warum?
DANKE!
[COLOR=#009900]}[/COLOR]