On my site: www.finmand.dk/almastofa/nyheder (a danish site) I have used this code to navigate between the post:
<?php foreach(get_the_category() as $category)
{ $thecat = $category->cat_ID; } ?>
<?php $result = "<ul class='lcp_catlist'>";
$catposts = get_posts('category='.$thecat."&orderby=monthly=asc&numberposts=".$NUMBEROFPOSTS);
foreach($catposts as $single):
$result .= "<li><a href='";
$result .=get_permalink($single->ID)."'>".$single->post_title."</a></li>";
endforeach;
$result .= "</ul>";
echo $result; ?>
This right thing about the code is that it only shows on the News page /Nyheder.
Problem is It only shows the newest post, and links to a page called sample-post. Which I don't have, so I get page not found. I would like it to link to page.php or single.php. But I can't figure out where to change it in the code. And I would like the navigation in the sidebar to be shown by Month and year posted. Not as now with name. But again - Beginner programmer with zero luck. So can anybody give me a hint on what to write?
I know I may be playing with the big boys now regarding knowledge about "heavy" programming, and my problem may seem insignificant - but we all have to start somewhere. Hopeful Thanks Marlene
