Wie man schon dem Titel entnehmen kann geht es um das kostenlose WD Theme ACOSMINMAG v1 und dem eingebauten Featured Article.
Der Featured Article wird vorher def., dass heisst, das der Featured Article nur Artikel aus einer bestimmten Kategorie verwendet,w elche vorher def. wird. Unter dem Featured Article erscheinen alle Artikel als "minipost", sprich die letzten verfassten Artikel.
Nach dem es nun leider bei mir in der Form keine Featured Article aus einer bestimmten Kategorie gibt, möchte ich, das der letzte geschriebene Artikel aus allen Kategorien als Featured Article dargestellt werden soll.
Leider bin ich dem PHP nicht so stark mächtig. Deswegen wollte ich fragen ob mir einer das kurz umschrieben könnte.
WEitere Informationen und die Daten zum Theme AcosminMAG v1 – free wordpress theme » By admin » article » Alexandru Cosmin
hier der Code um welchen es geht(index.php):
<?php get_header(); ?>
<div id="posts">
<?php $featured = new WP_Query('cat=17&showposts=2');
while ($featured->have_posts()) : $featured->the_post();
$noduplicates = $post->ID; ?>
<div id="featured">
<div class="top">
<h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a></h1>
<ul>
<li class="author">
<?php the_author() ?>
<?php edit_post_link(' | Edit'); ?>
</li>
<li class="comments">
<?php comments_popup_link('No comments', '1 Comment', '% Comments'); ?>
</li>
<li class="date">
<?php the_time('M j,Y') ?>
</li>
<li class="featured">Featured Article</li>
</ul>
</div>
<div id="featcontent">
<?php the_content('Read the rest of this entry » '); ?>
</div>
</div>
<?php endwhile; ?>
<div id="miniposts">
<?php
$postnum = 1;
$showdiv = 1;
?>
<?php $pagination = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<?php $novideos = new WP_Query('cat=-15&showposts&orderby=post_date&order=desc&paged=' . $pagination); $wp_query->in_the_loop = true; ?>
<?php if (have_posts()) : while ($novideos->have_posts()) : $novideos->the_post(); if( $post->ID == $noduplicates )
continue;?>
<div class="post2" id="post-<?php the_ID(); ?>">
<ul class="minitop">
<li class="miniauthor">
<?php the_author() ?><?php edit_post_link(' | Edit'); ?>
</li>
<li class="minicomments">
<?php comments_popup_link('No comments', '1 Comment', '% Comments'); ?>
</li>
<li class="minidate">
<?php the_time('j M Y') ?>
</li>
</ul>
<h1><a title='Permanent Link to <?php the_title(); ?>' href='<?php the_permalink() ?>' rel='bookmark'>
<?php the_title(); ?>
</a></h1>
<?php the_content('Read the rest of this entry »'); ?>
</div>
<?php if ($postnum == $showdiv) { ?>
<div class="ad468"> <a href="#" title="#"><img src="<?php bloginfo('template_url'); ?>/images/ad3.gif" alt="468" /></a> </div>
<?php } ?>
<?php $postnum++; ?>
<?php endwhile; ?>
<?php endif; ?>
<div id="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
</div>
<div id="sidebar2">
<?php include('sidebar160.php'); ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Alles anzeigen
An dieser Stelle schon mal Danke:-D
Mfg