Moin zusammen,
ich würde gern auf meiner Seite den ersten Artikel immer komplett anzeigen lassen und die vorherigen sollen darunter nur mit der Überschrift als Liste angezeigt werden.
Kann ich das irgenwie unkompliziert realisieren?
:confused:
Um schreiben oder kommentieren zu können, benötigen Sie ein Benutzerkonto.
Sie haben schon ein Benutzerkonto? Melden Sie sich hier an.
Jetzt anmeldenHier können Sie ein neues Benutzerkonto erstellen.
Neues Benutzerkonto erstellenMoin zusammen,
ich würde gern auf meiner Seite den ersten Artikel immer komplett anzeigen lassen und die vorherigen sollen darunter nur mit der Überschrift als Liste angezeigt werden.
Kann ich das irgenwie unkompliziert realisieren?
:confused:
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
So wie auf meiner Seite etwa? > SCHLOEBE.DE - Personal Portfolio von Oliver Schlöbe -
Abgespeckte Version:
<!-- Erster Beitrag -->
<?php $top_query = new WP_Query('showposts=1'); ?>
<?php while($top_query->have_posts()) : $top_query->the_post();
$do_not_duplicate = $post->ID; ?>
<div class="article" id="post-<?php the_ID(); ?>">
<div class="datetable"><small><?php the_time('M') ?></small><br /><span class="textmark"><?php the_time('j.') ?></span><br /><small><?php the_time('Y') ?></small></div>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a></h1>
<br />
<?php the_content('(Mehr...)'); ?>
<div class="feedback">
<?php wp_link_pages(); ?>
<span class="link-categorie"><?php the_category(', ') ?></span> <?php comments_popup_link(__('Schreib was...'), __('1 Kommentar'), __('% Kommentare'), 'link-comentariu', __('Kommentare deaktiviert')); ?>
</div>
</div>
<div class="line"></div>
<?php endwhile; ?>
<!-- Weitere Beiträge als Liste -->
<h1>Weitere Beiträge</h1>
<br />
<?php $top_query2 = new WP_Query('showposts=100&offset=1'); ?>
<?php while($top_query2->have_posts()) : $top_query2->the_post();
$do_not_duplicate = $post->ID; ?>
<div style="padding:0px;" class="moreposts"><div class="datetable2" style="float:left;"><?php the_time('d. m Y'); ?></div> <h1 style="display:inline;padding:5px;margin:0;float:right;background:#fff;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<br style="clear:right;" /></div>
<?php endwhile; ?>
Alles anzeigen
Jupp, so isses. :)
danke :mrgreen::mrgreen:
Hm ... Ich versteh noch nicht ganz, wo ich das dann einfügen kann.
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h1><strong><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></strong></h1>
<?php the_content('... weiterlesen ... »'); ?>
<p class="postmeta"><img src="<?php bloginfo('template_directory'); ?>/images/calendar.png" align="top" alt="Date" /> <?php the_time('d.m.y'); ?> | <img src="<?php bloginfo('template_directory'); ?>/images/tag.png" align="top" alt="Category" /><?php the_category(', ') ?> | <img src="<?php bloginfo('template_directory'); ?>/images/comments.png" align="top" alt="Kommentare" /> <?php comments_popup_link('Keine Kommentare »', '1 Kommentar »', '% Kommentare »'); ?> | <?php if(function_exists('wp_print')) { print_link(); } ?> | <?php if(function_exists('wp_email')) { email_link(); } ?> . <?php edit_post_link('edit', '', ' '); ?>
</div>
<?php endwhile; ?>
<?php wp_pagebar(array('before'=>'Seite: '))?>
<?php else : ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<?php include (TEMPLATEPATH . '/sidebarRight.php'); ?>
<?php include (TEMPLATEPATH . '/sidebarleft.php'); ?>
<?php get_footer(); ?>
Alles anzeigen
in die index.php falls du dafür keine andere Startseite vorgesehen hast!
in die index.php falls du dafür keine andere Startseite vorgesehen hast!
Ne is klar, der Code ist das wahrscheinlich. Die Frage ist, wo da rein :-D.
Ne is klar, der Code ist das wahrscheinlich. Die Frage ist, wo da rein :-D.
Diesen Teil mit meinem Code ersetzen:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h1><strong><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></strong></h1>
<?php the_content('... weiterlesen ... »'); ?>
<p class="postmeta"><img src="<?php bloginfo('template_directory'); ?>/images/calendar.png" align="top" alt="Date" /> <?php the_time('d.m.y'); ?> | <img src="<?php bloginfo('template_directory'); ?>/images/tag.png" align="top" alt="Category" /><?php the_category(', ') ?> | <img src="<?php bloginfo('template_directory'); ?>/images/comments.png" align="top" alt="Kommentare" /> <?php comments_popup_link('Keine Kommentare »', '1 Kommentar »', '% Kommentare »'); ?> | <?php if(function_exists('wp_print')) { print_link(); } ?> | <?php if(function_exists('wp_email')) { email_link(); } ?> . <?php edit_post_link('edit', '', ' '); ?>
</div>
<?php endwhile; ?>
Alles anzeigen
Vorher bitte Backup der alten Datei!
So wie auf meiner Seite etwa? > SCHLOEBE.DE - Personal Portfolio von Oliver Schlöbe -
Abgespeckte Version:
PHP Alles anzeigen<!-- Erster Beitrag --> <?php $top_query = new WP_Query('showposts=1'); ?> <?php while($top_query->have_posts()) : $top_query->the_post(); $do_not_duplicate = $post->ID; ?> <div class="article" id="post-<?php the_ID(); ?>"> <div class="datetable"><small><?php the_time('M') ?></small><br /><span class="textmark"><?php the_time('j.') ?></span><br /><small><?php the_time('Y') ?></small></div> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"> <?php the_title(); ?> </a></h1> <br /> <?php the_content('(Mehr...)'); ?> <div class="feedback"> <?php wp_link_pages(); ?> <span class="link-categorie"><?php the_category(', ') ?></span> <?php comments_popup_link(__('Schreib was...'), __('1 Kommentar'), __('% Kommentare'), 'link-comentariu', __('Kommentare deaktiviert')); ?> </div> </div> <div class="line"></div> <?php endwhile; ?> <!-- Weitere Beiträge als Liste --> <h1>Weitere Beiträge</h1> <br /> <?php $top_query2 = new WP_Query('showposts=100&offset=1'); ?> <?php while($top_query2->have_posts()) : $top_query2->the_post(); $do_not_duplicate = $post->ID; ?> <div style="padding:0px;" class="moreposts"><div class="datetable2" style="float:left;"><?php the_time('d. m Y'); ?></div> <h1 style="display:inline;padding:5px;margin:0;float:right;background:#fff;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1> <br style="clear:right;" /></div> <?php endwhile; ?>
besteht auch die möglichkeit deinen code so zu schreiben das ich ihn in einer eigenen statischen seite einfügen kann. weil ich das mit der index.php bei mir nicht hinbekomme??
Oder kann mir einer vielleicht den code in meiner index.php einbauen oder sagen was ich ändern soll bekomme es leider nicht alleine hin.
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<p class="date">
<?php the_time(__('l, F dS, Y','avenue')) ?> | <?php _e('Author: ','avenue'); ?><?php the_author_posts_link('nickname'); ?>
<span class="edit">
<?php edit_post_link(' » Edit «','',''); ?></span></p>
<div class="entry">
<?php if ( is_home() ) { ?><?php the_content(__('more...','avenue')); ?><?php } ?>
<?php if ( is_search() ) { ?><?php the_excerpt() ?><?php } ?>
</div><!-- End Entry -->
<p class="info"><span class="category"><?php _e('Category: ','avenue'); ?>
<?php the_category(', ') ?></span> | <span class="bubble"><?php comments_popup_link(__('Leave a Comment','avenue'), __('One Comment','avenue'), __('% Comments','avenue'), '', __('Comments off','avenue')); ?></span></p>
</div><!-- End Post -->
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php posts_nav_link('','',__('« previous Entries','avenue')) ?></div>
<div class="alignright"><?php posts_nav_link('',__('next Entries »','avenue'),'') ?></div>
</div><!-- End Navigation -->
<?php else : ?><h1><?php _e('Not found','avenue'); ?></h1>
<p class="sorry"><?php _e("Sorry, but you are looking for something that isn't here. Try something else.",'avenue'); ?></p>
<?php endif; ?>
</div><!-- End Content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
[COLOR="Red"]Vorher deine index.php sichern!![/COLOR]
Versuch es damit:
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) : ?>
<!-- Erster Beitrag -->
<?php $top_query = new WP_Query('showposts=1'); ?>
<?php while($top_query->have_posts()) : $top_query->the_post();
$do_not_duplicate = $post->ID; ?>
<div class="article" id="post-<?php the_ID(); ?>">
<div class="datetable"><small><?php the_time('M') ?></small><br /><span class="textmark"><?php the_time('j.') ?></span><br /><small><?php the_time('Y') ?></small></div>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?>
</a></h1>
<br />
<?php the_content('(Mehr...)'); ?>
<div class="feedback">
<?php wp_link_pages(); ?>
<span class="link-categorie"><?php the_category(', ') ?></span> <?php comments_popup_link(__('Schreib was...'), __('1 Kommentar'), __('% Kommentare'), 'link-comentariu', __('Kommentare deaktiviert')); ?>
</div>
</div>
<div class="line"></div>
<?php endwhile; ?>
<!-- Weitere Beiträge als Liste -->
<h1>Weitere Beiträge</h1>
<br />
<?php $top_query2 = new WP_Query('showposts=100&offset=1'); ?>
<?php while($top_query2->have_posts()) : $top_query2->the_post();
$do_not_duplicate = $post->ID; ?>
<div style="padding:0px;" class="moreposts"><div class="datetable2" style="float:left;"><?php the_time('d. m Y'); ?></div> <h1 style="display:inline;padding:5px;margin:0;float:right;background:#fff;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<br style="clear:right;" /></div>
<?php endwhile; ?>
<?php else : ?><h1><?php _e('Not found','avenue'); ?></h1>
<p class="sorry"><?php _e("Sorry, but you are looking for something that isn't here. Try something else.",'avenue'); ?></p>
<?php endif; ?>
</div><!-- End Content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
erstmal danke für deine hilfe also es klappt perfekt bis auf eine kleinigkeit das der style nicht so ganz hinhaut.
Lässt sich so einfach per Bild gar nicht sagen... sieht so aus, als richtest du die <h1>-Tags rechts aus, was in dem Fall blöd aussieht.
Versuch mal das hier:
<!-- Weitere Beiträge als Liste -->
<h1>Weitere Beiträge</h1>
<br />
<?php $top_query2 = new WP_Query('showposts=100&offset=1'); ?>
<?php while($top_query2->have_posts()) : $top_query2->the_post();
$do_not_duplicate = $post->ID; ?>
<div style="padding:0px;" class="moreposts"><div class="datetable2" style="float:left;"><?php the_time('d. m Y'); ?></div> <h1 style="display:inline;padding:5px;margin:0;float:right;background:#fff;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<br style="clear:right;" /></div>
<?php endwhile; ?>
Alles anzeigen
zu ersetzen mit:
<!-- Weitere Beiträge als Liste -->
<h1>Weitere Beiträge</h1>
<br />
<?php $top_query2 = new WP_Query('showposts=100&offset=1'); ?>
<?php while($top_query2->have_posts()) : $top_query2->the_post();
$do_not_duplicate = $post->ID; ?>
<div style="padding:0px;" class="moreposts"><?php the_time('d. m Y'); ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1></div>
<?php endwhile; ?>
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!