Hai.
Wie kann ich Custom Fields in der index.php ausgeben?
Meine Schleife in der index.php sieht derzeit so aus:
PHP
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="posts_index">
<a href="<?php the_permalink() ?>"><?php
$data = $wpdb->prefix . "posts";
$query = "SELECT guid FROM $data WHERE post_type = 'attachment' AND post_parent = " . $post->ID;
$bild= $wpdb->get_var( $query );
echo('<img src=' . $bild . ' height="125px" width="125px" alt="" style="" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80"/>');
?><?php the_title(); ?></a>
</div>
<?php endwhile; ?>
Es wird also nur das Bild des Posts und der Posttitel ausgeben. Ich möchte allerdings, dass unter dem Titel noch ein Customfield ausgegebn wird. Ich habe es mit folgendem Code versucht:
Da zeigt es allerdings nichts an... Kommt allerdings auch kein Fehler oder iwas anderes... Weiß jemand Rat?:|
Gruß.
STVN!