Hallo,
ich würde gern wissen wie ich auf einer Page gleichzeitig den Inhalt der Page den ich im Adminbereich ja schreiben und gestalten kann anzeigen lassen kann und dabei Posts aus einer Kategorie anzeigen lassen kann. Ich habe es per Template schon hinbekommen, dass mir alle Posts einer Kategorie angezeigt werden, nur die der Page sind dann weg.
Vielen Dank schonmal für die Hilfe ;)
P.S.:Hier mein Versuch:
PHP
<?php
/**
*
* Template Name: list_news
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the wordpress construct of pages
* and that other 'pages' on your wordpress site will use a
* different template.
*
* @package WordPress
* @subpackage STTF
* @since STTF 1.0
*/
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php query_posts('category_name=news'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><?php the_title(); ?></h2>
<div class="entry-content">
<?php $teaser = get_post_custom_values('teaser'); ?>;
<?php if(!(empty($teaser))) { ?><?php echo $teaser[0]; ?><?php } ?>
<a href="<?php the_permalink() ?>"> Mehr erfahren </a>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen