I've found this code to bring in the titles and links to the latest three blogs on our site:
<div class="latest-blogs">
<?php wp_get_archives('type=postbypost&limit=3&format=latest-blog'); ?>
</div>
I need to know how to add formatting so that each title is on its own line, separated either by a <p> or a
(preferably a
)
Can anybody tip me off on how to do this?
Instead of trying to add HTML, consider using CSS styling instead.
Give a link to your blog, so we can see the HTML being generated.
also, that would be like, latest-blogs a , or latest-blogs h4, h2, h1
and so on, you would create these styles in the theme style.css file and see what happens
and if you are on mac try using cssEdit
Thanks for the speedy replies. This is the page. It's the green section under the large photo "Latest from the blog." If you'll check the source, I'm not able to add at least a line break between the links.
http://www.addiva.net/blog/home/
how about
.latest-blogs a {
line-height: 22px;
}
That would make it look a little better, but what I'm aiming for is something like:
- It’s not easy being green, especially for ADD women
- ADHD Hummingbirds?
- Proud mom of an ADDiva-in-training
Thanks!
well adding this
list-style-type: disc;
should do the trick
But there are no <li>s there. I can't figure out how to get this tag I found in the codex:
<?php wp_get_archives('type=postbypost&limit=3&format=latest-blogs'); ?>
to output a list instead of a big run on sentence like it is. There's nothing there to create a list with any kind of line break. I'd settle for a simple <br /> at this point.
Does wordpress have a tag that will generate an ~ordered~ list of blog titles/links rather than this unordered one?
i don't think so, lists and so on are generated because they are in a tag such as
Found it! It's
<ul>
<?php
global $post;
$myposts = get_posts('numberposts=4&offset=1');
foreach($myposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
see its in a
tag thats what putting it in a list, glad you have found it, very useful actually :)
<?php wp_get_archives('type=postbypost&limit=3&format=latest-blogs'); ?>
What is that "format=latest-blog" bit for? If you remove that, you'll get it in a list format.
<ul class="latest-blogs">
<?php wp_get_archives('type=postbypost&limit=3'); ?>
</ul>