Niclas
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Display the 5 most recent postsThanks!
Just for the record, this is the code I used:
<ul>
<?php
$myposts = get_posts('numberposts=5&offset=1&category=1');
foreach($myposts as $post) :
?>
<li><a>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
Forum: Fixing WordPress
In reply to: Linking to a categorygot it all worked out now. Thanks for the help!
Forum: Fixing WordPress
In reply to: Linking to a categoryI’ve got a new problem.
I tried creating a new page, like Skippy told me. And I’ve used the get_posts tags to include the posts from the Tutorial category into the Tutorials page.This is the code I’ve used
<?php
$posts = get_posts('numberposts=3');
foreach($posts as $post) :
setup_postdata($post);
?>
<a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
<?php endforeach; ?>But when I try to run it, wordpress gives me an error saying: “Warning: Invalid argument supplied for foreach() in /***/***/public_html/blog/wp-content/themes/ennbee2/tutorials.php on line 16”
What am I doing wrong?
Forum: Fixing WordPress
In reply to: Linking to a categorythanks! that solved the problem. I wonder why I never thought of including the link the same way I’m including the home link.
Anyway, thanks!
Forum: Fixing WordPress
In reply to: Linking to a categoryOk, I’ll try to explain a little bit better:
https://niclas.pigne.net/blog <- I want to link to the category “Tutorials” under “Navigation”. Am I clear enough? ??
If it’s possible, I would like to hide Tutorials from the archives to. any tips on doing that?
Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemsthanks man! that did the trick.
Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemsforgive me for asking, but what plugin? I’ve haven’t seen any link to a plugin. All I’ve seen is a codesnippet that adds a home link to the navigation.
Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemsno it wasn’t. I tried to change ./ to https://niclas.pigne.net/blog and got this instead: https://niclas.pigne.net/blog/%5C%22https://niclas.pigne.net/blog/%5C%22
Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemsI’ve changed a bit in the code now:
<?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __('Navigation') . '</h2> <ul><li><a href="./" title="Home">Home</a></li></ul>'); ?>And it works as intended now, except that the home link is formatted like this:
https://www.niclas.pigne.net/blog/%5C%22./%5C%22Is it the
<a href="./" title="Home">
that causes all the fuss?Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problems
<?php
$pages = wp_list_pages('sort_column=menu_order&exclude=6&title_li=<h2>' . __('Navigate') . '</h2><ul>
<li><a href="./" title="Home">Home</a></li>
</ul>
&echo=0');
echo stripslashes($pages);
?>Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemshttps://niclas.pigne.net/enabled.jpg – this is what the layout look like when I have multiple pages and uses your hack to add a “Home” link at the top.
https://niclas.pigne.net/disabled.jpg – without using multiple pages, this is what it should look like.
I’m using the lates wordpress (1.5.1.2) by the way.
Forum: Fixing WordPress
In reply to: Sidebar link to static homepage – problemsit doesn’t work at all, when I use that string of codes it makes everything in my posts and pages disapear besides the first character.