Hallo erst mal, ich bin ein absoluter WP-Neuling und habe bislang auch mit php nur sporadisch zu tun gehabt bzw. einfache Sachen gemacht. Insofern möget ihr mir verzeihen, wenn ich etwas begriffsstutzig erscheine ...
Folgendes Problem: Ich habe mit dem Twentyten-Theme einige Seiten aufgebaut. Nun möchte ich auf einer bestimmten Seite alle Artikel einer Kategorie VOLLSTÄNDIG zeigen. Dazu habe ich die Theme-Index-Seite kopiert und ihr erst mal einen neuen Template-Namen gegeben:
Nun habe ich noch eine Zeile Code eingefügt:
Der Code der gesamten Seite sieht nun so aus:
<?php
/*
Template Name: cat_archiv
*/
?>
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php query_posts('category_name=cat_archiv'); ?>
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php if (function_exists('wpdirectory')) wpdirectory(); ?>
Alles anzeigen
Die statische Seite mit dem neuen Template zeigt nun auch alle Artikel der einen angesprochene Kategorie, leider aber nicht vollständig, sondern im Galerieformat - obwohl im Artikel die Standard-Formatvorlage angeklickt ist.
Ich vermute ja, dass ich in die query_posts-Funktion noch weitere Optionen eintragen muss, weiß allerdings nicht wie bzw. was. Wäre super, wenn mir jemand weiterhelfen könnte. Vorab schon mal Danke für eure Hilfe!