Sziasztok!
Azt hogy lehetne megoldani, hogy a pl főoldalon csak 1 bizonyos kategória cikketi szeretném kilistázni, pl az utolsó 5 dbot?
Ezzel a kóddal úgy teszi ki, hogy utolsó cikkek (Nem csak 1 kategória), és a bevezetőjével meg a thumb-al. Vagy esetleg ezt valahogy átalakítani?!:
Code:
<?php
if (have_posts(1)) : $count = 0;
while(have_posts()) : the_post();
$count++;
if ($count>5) break;
$thumb = get_post_meta($post->ID, 'articleimg', $single = true);
?>
<?php // if there's a thumbnail
if($thumb !== '') { ?>
<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>
<?php comments_popup_link('Nincs hozzászólás', '1 hozzászólás', '% hozzászólás'); ?>
<?php
$content = get_the_content('',FALSE,'');
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo substr($content,0,210);
?>…
if (have_posts(1)) : $count = 0;
while(have_posts()) : the_post();
$count++;
if ($count>5) break;
$thumb = get_post_meta($post->ID, 'articleimg', $single = true);
?>
<?php // if there's a thumbnail
if($thumb !== '') { ?>
<img src="<?php echo $thumb; ?>"
/>
<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>
<?php the_title(); ?>
<?php comments_popup_link('Nincs hozzászólás', '1 hozzászólás', '% hozzászólás'); ?>
<?php
$content = get_the_content('',FALSE,'');
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo substr($content,0,210);
?>…