Zurück   WordPress Deutschland Forum > Support > Konfiguration

Antwort
 
Themen-Optionen Ansicht
Alt 15.06.2008, 15:02   #1 (permalink)
PostRank: 0
 
Registriert seit: 11.06.2008
Beiträge: 15
Ersten Beitrag ganz anzeigen, alle anderen kürzen

Hallo zusammen,
ich möchte gerne meine Blog so abändern, dass nur der erste Bietrag ganz angezeigt wird und die weiteren Beiträge auf der Startseite mit einem "weiter lesen" link abgekürzt werden...
Das sollte automatisch funktionieren ohne, dass der more tag bei jedem Artikel vom Autor eingebaut wird.
Ich habe dieses Feature bei dem Theme Prodown entdeckt und würde sie gerne in mein Theme einbauen.

So schaut die index.php bei Prodown aus.
Ich habe die Bereiche, die für die veränderte Anzeige verantwortlich sind markiert. Zumindest glaube ich, dass das die Bereiche sind
Wenn ich den markierten Code aber versuche auf mein Theme zu übertragen, dann erhalte ich eine weiße Seite....

Hat jemand einen Tipp, wie ich dieses Feature auf andere Themes übertragen kann?

Code:
<?php get_header(); ?>

<div id="contentarea">

  <?php $x=TRUE; if (have_posts()) : ?>
            <?php while (have_posts() && $x) : the_post(); ?>
            <?php $x=FALSE; ?>
                
            <div class="post">
            
                <div class="posttop">
                    <div class="dateicon">
                        <div class="dateday"><?php the_time('d') ?></div> 
                        <div class="datemonth"><?php the_time('M') ?></div>
                    </div>
            
                    <div class="posttitle">
                        <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                        <div class="postdetailstop">Posted by <?php the_author() ?>, in <?php the_category(', ') ?></div>
                    </div>
                </div>
            
            
                <div class="entry">
                    <?php the_content('Read the rest of this entry &raquo;'); ?>
                    <?php edit_post_link('Edit this post','',''); ?> 
                </div>            
            
                <?php include (TEMPLATEPATH . '/adsense.php'); ?>
        </div>
            
                <?php trackback_rdf(); ?>

        <?php endwhile; ?>

        <br/>
    <?php else : ?>

        <h2 class="center">Not Found</h2>
        <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?></p>
        <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    <?php endif; ?>

              <?php $y=TRUE; if (have_posts()) : ?>
              
              <div class="post">
            
            <div class="posttop">
            
                    <div class="posttitle">
                        <h2>&nbsp;&nbsp;Latest Posts</h2>
                        <div class="postdetailstop">&nbsp;&nbsp;&nbsp;&nbsp;Latest from <?php bloginfo('name'); ?></div>
                    </div>
                </div>
                
                <div class="latestposts">
            <?php while (have_posts() && $y) : the_post(); ?>
            <?php $y=TRUE; ?>
            
                <div class="entry">
                    <strong>
                        <a id="post-<?php the_ID(); ?>" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
                    </strong>    <br/>    
                    Posted on <?php the_time('l, F jS, Y') ?><br/>        
                    <?php the_excerpt() ?>
                    <a href="<?php the_permalink() ?>">Read Full Post</a>
                    <hr/>
                </div>
                                
                
            <?php endwhile; ?></div><?php include (TEMPLATEPATH . '/adsense_latestposts.php'); ?>
            
            </div><br/><br/><br/>
            <?php endif; ?>
            
            
 </div>    <?php get_sidebar(); ?>
<?php get_footer(); ?>
Mats70 ist offline   Mit Zitat antworten
Alt 15.06.2008, 15:17   #2 (permalink)
msi
PostRank: 4
 
Registriert seit: 01.02.2007
Beiträge: 254
Welches Thema nutzt du denn?
msi ist offline   Mit Zitat antworten
Alt 15.06.2008, 16:46   #3 (permalink)
PostRank: 0
 
Registriert seit: 11.06.2008
Beiträge: 15
Hallo msi,
als Theme nutze ich Greendog 2.0

Da schaut die index.php folgendermaßen aus:

Code:
<?php get_header(); ?>

<div id="centerTL">
<div id="centerTR">
<div id="centerBR">
<div id="centerBL">
    <div id="container">
        <div id="left">
        
        <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>
            
            <div class="post" id="post-<?php the_ID(); ?>">
                <div class="postHeader">
                <p class="cal"><?php the_time('j') ?><small><?php the_time('F') ?></small></p>
                <h1><a href="<?php the_permalink() ?>" title="Permanenter Link zu &laquo;<?php the_title(); ?>&raquo;"><?php the_title(); ?></a></h1>
                <p class="desc"><span class="autor" title="Autor"><?php the_author() ?></span>&nbsp;<span class="cat" title="Kategorie"><?php the_category(' &raquo; ') ?></span><?php edit_post_link('Bearbeiten',' | ',''); ?></p>
                </div>
                
                <div class="postBody">
                  <?php the_content('Weiter lesen &raquo;'); ?>
                


<?php if ( is_single()) { ?>
<br /><p><b>Beitragsinfo</b><br />
geschrieben von <?php the_author() ?> am  <?php the_time('j. M Y') ?><br />
abgespeichert in der Kategorie <?php the_category(', ') ?></p>
<?php st_the_tags('before=Stichworte: ', 'simpletags'); ?>
<br /><p><b>Beiträge, die dich auch interessieren könnten:</b><br />
<?php st_related_posts('number=5&title=&include_page=false&xformat=<a href="%permalink%" title="%title% (%date%)">%title%</a>'); ?>
<?php } ?></p>

</div>

            
                <div class="postFooter">
          <span class="postComm"><?php comments_popup_link('0 Kommentare', '1 Kommentar', '% Kommentare'); ?></span>
                </div>
            </div>
            
            <?php comments_template(); ?>
            
            <?php endwhile; ?>
            
            <ul class="postScroll">
                <li class="next"><?php next_posts_link('Fr&uuml;here') ?></li>
                <li class="prev"><?php previous_posts_link('Sp&auml;tere') ?></li>
            </ul>
            
        <?php else : ?>
        
            <h3>Keinen Eintrag gefunden.</h3>
            
        <?php endif; ?>
            
        </div>





<?php get_sidebar(); ?>

<?php get_footer(); ?>
Mats70 ist offline   Mit Zitat antworten
Alt 15.06.2008, 17:24   #4 (permalink)
PostRank: 0
 
Registriert seit: 11.06.2008
Beiträge: 15
Ich habe meine index.php nun mal versucht anzupassen
- erste Loop für den Artikel der komplett angezeigt wird
- zweite Loop für die gekürzten Einträge

Leider erhalte ich erhalte eine blank page!?!
Hat jemand einee Idee wo das script hängt?

Code:
<?php get_header(); ?>

<div id="centerTL">
<div id="centerTR">
<div id="centerBR">
<div id="centerBL">
    <div id="container">
        <div id="left">
        
  <?php $x=TRUE; if (have_posts()) : ?>
            <?php while (have_posts() && $x) : the_post(); ?>
            <?php $x=FALSE; ?>
            
            <div class="post" id="post-<?php the_ID(); ?>">
                <div class="postHeader">
                <p class="cal"><?php the_time('j') ?><small><?php the_time('F') ?></small></p>
                <h2><a href="<?php the_permalink() ?>" title="Permanenter Link zu &laquo;<?php the_title(); ?>&raquo;"><?php the_title(); ?></a></h2>
                <p class="desc"><span class="autor" title="Autor"><?php the_author() ?></span>&nbsp;<span class="cat" title="Kategorie"><?php the_category(' &raquo; ') ?></span><?php edit_post_link('Bearbeiten',' | ',''); ?></p>
                </div>
                
                <div class="postBody">
                  <?php the_content('Weiter lesen &raquo;'); ?>
                </div>
            
                <div class="postFooter">
          <span class="postComm"><?php comments_popup_link('0 Kommentare', '1 Kommentar', '% Kommentare'); ?></span>
                </div>
            </div>
            
            <?php comments_template(); ?>
            
            <?php endwhile; ?>
            
            <ul class="postScroll">
                <li class="next"><?php next_posts_link('Fr&uuml;here') ?></li>
                <li class="prev"><?php previous_posts_link('Sp&auml;tere') ?></li>
            </ul>
            
        <?php else : ?>
        
            <h3>Keinen Eintrag gefunden.</h3>
            
        <?php endif; ?>

              <?php $y=TRUE; if (have_posts()) : ?>
              <h4>weitere Artikel</h4>
              <?php while (have_posts() && $y) : the_post(); ?>
            <?php $y=TRUE; ?>
            <div class="post" id="post-<?php the_ID(); ?>">
                <div class="postHeader">
                <p class="cal"><?php the_time('j') ?><small><?php the_time('F') ?></small></p>
                <h2><a href="<?php the_permalink() ?>" title="Permanenter Link zu &laquo;<?php the_title(); ?>&raquo;"><?php the_title(); ?></a></h2>
                <p class="desc"><span class="autor" title="Autor"><?php the_author() ?></span>&nbsp;<span class="cat" title="Kategorie"><?php the_category(' &raquo; ') ?></span><?php edit_post_link('Bearbeiten',' | ',''); ?></p>
                </div>
                
                <div class="postBody">
                    <?php the_excerpt() ?>
                    <a href="<?php the_permalink() ?>">Read Full Post</a>
                  </div>
            
        </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Geändert von Mats70 (15.06.2008 um 20:04 Uhr).
Mats70 ist offline   Mit Zitat antworten
Alt 15.06.2008, 23:22   #5 (permalink)
PostRank: 0
 
Registriert seit: 11.06.2008
Beiträge: 15
Nach langer Suche bin fündig geworden.
Vielleicht hilft es ja auch anderen weiter...

Was ich gesucht habe nennt sich Mullets Loop

Wenn das Ganze einen Namen hat, ist es doch gleich viel leichter

viele Grüße
Matthias
Mats70 ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist aus.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:28 Uhr.


Powered by vBulletin® Version 3.7.4 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 | Impressum | Ein Inpsyde.com Projekt