WN

WN (https://www.wn.se/forum/index.php)
-   Serversidans teknologier (https://www.wn.se/forum/forumdisplay.php?f=4)
-   -   Wordpress, lägga in posts i en Template page? (https://www.wn.se/forum/showthread.php?t=34178)

JesperA 2008-12-29 19:52

Tjenare!

Försöker göra en Template Page i wordpress och få in poster från kategorin "Nyheter", att hämta och visa dom är inga problem men den verkar inte få in vissa funktioner, bland annat fungerar inte <!--more--> funktionen.

Jag tog bara indexfilen och la till detta längst upp:

Kod:

<?php
/*
Template Name: Nyheter
*/
?>

Innan loopen har jag lagt in en query post:

Kod:

<?php query_posts('category_name=Nyheter'); ?>
Sen den gamla vanliga (ostylade än sålänge:

Kod:

<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?></a></h2>
<p><?php the_time('F jS, Y') ?> <?php the_author() ?></p>

<?php the_content('Läs mer...'); ?>

</div>

<?php endwhile; ?>


<?php endif; ?>

Har exakt samma kod, exakt samma på index filen och där fungerar den perfekt.
Men här på min nyhetssida fungerar inte "more" taggen

Går det inte att ha query posts på Template Pages?


[CODE]


Alla tider är GMT +2. Klockan är nu 12:33.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson