Guten Abend!
Ich mache für einen Bekannten ein WP-Blog. Da er einen Download-Bereich möchte, habe ich mir gedacht, dass ich eine Kategorie "Download" mache und die ganze Kategorie in eine statische Seite packe.
Es stellte sich heraus, dass das für mich nicht sehr einfach ist.
Nach vielen Codes (get, list ect.) ist nichts herausgekommen, so habe ich eine Vorlage für die Seiten gemacht. Habe sie von archive.php und verändert.
Meine Frage: Gibt es ein Code, der eine bestimmte Kategorie anzeigt? Z.B. nur ID 4.
Link zum "möchte-gern-Downloadbereich" :mrgreen:
Meine Vorlage downloads.php
PHP
<?php
/*
Template Name: Downloads
*/
?><?php get_header(); ?>
<div id="primary" class="single-post">
<div class="inside">
<div class="utom">
<div class="primary">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<h1>Download-Archiv</h1>
****Anzeigen der Kategorie 4****
<?php while (have_posts()) : the_post(); ?>
<div class="story">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Link zu <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<div class="postin">
<span class="p_author"><?php the_author() ?></span>
</span>
<?php if ( (function_exists('UTW_ShowTagsForCurrentPost')) ) { ?><span class="p_tags"><?php UTW_ShowTagsForCurrentPost("commalist") ?></span><?php }?>
<span class="p_read"><a href="<?php the_permalink() ?>">Download ansehen</a></span>
</div>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="left"><?php next_posts_link('« Vorheriger Eintrag') ?></div>
<div class="right"><?php previous_posts_link('Nächster Eintrag »') ?></div>
</div>
<?php else : ?>
<h1>Seite nicht gefunden.</h1>
<?php endif; ?>
</div>
<div class="secondary">
<h2>Info</h2>
<div class="featured">
<p>Willkommen im Download-Bereich. Schau dich doch um.</p>
</div>
</div>
<div class="secondary2">
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
Danke