Moin Zusammen.
Ich benutze das Plugin Easzyest Gallery http://wordpress.org/plugins/eazyest-gallery/ welches Customfields Unterstützt.
Da mir die Standard Übersicht nicht reicht und ich noch gerne eine Archiv Übersicht nach Städten bzw Orten in meinen Blog einfügen möchte habe ich mir gedacht ich benutze dafür Custom Fields.
Ich habe mir ein Seiten Template erstellt welches eigentlich Alle Posts mit dem Customfield geolocation und dem dazugehörigen Wert zb denrwessen (für die Stadt Essen) Anzeigen soll.
Erstellt habe ich es nach dem Vorlbild von : http://codex.wordpress.org/Displaying_Pos…om_Select_Query
Nun mein Problem immer wenn ich die Seite mit dem dazugehörigen Post Template aufrufe bekomme ich den Internen Serverfehler 500.
Fällt irgendwem ein Fehler von mir auf? Oder liegt es einfach an einer schlechten Konfiguration des Webspaces
Mein Template:
<?php/** * Template Name: place_child */
get_header();?><?php
$querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'geolocation' AND $wpdb->postmeta.meta_value = 'denrwessen' AND $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_date < NOW() ORDER BY $wpdb->posts.post_date DESC ";
$pageposts = $wpdb->get_results($querystr, OBJECT); ?>
<section class="page"><section class="content"><article class="post">
<?php if ($pageposts): ?> <?php global $post; ?> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> </div> <?php endforeach; ?> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?>
<footer class="postfooter"> <nav><ul><li><?php comments_popup_link( '0 Kommentare', '1 Kommentar', '% Kommentare', 'comments-link', 'Kommentare: closed');?></li><li><a href="<?php the_permalink() ?>/#respond" >Kommentar Verfassen</a></li><li><a href="<?php the_permalink() ?>"> Weiterlesen</a></li></ul></nav>
</footer></article></section>
<?php get_sidebar(); ?> </section>
<?php get_footer(); ?>
Alles anzeigen