• I have a list of “most recent posts” in my sidebar, and right now it just goes BULLET+HEADLINE. What I’d really like is if it instead said BULLET+X+HEADLINE.

    More specifically, it’s now “=> VCR”, and then “=> Brush”… what I need instead is, “=> Definition of VCR” and then “=> Definition of Brush”.

    How could I add just that text so it appears before each item in the list?

    The code I’m working with is this:
    <?php wp_get_archives(‘type=postbypost&limit=10’); ?>

    And the site is https://www.thebabydictionary.com, if it helps.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Maybe this, but not sure if you need it before the bullet.

    <?php wp_get_archives('before=&laquo;'); ?>

    You could maybe make a key for it whatever text you want.
    <?php $key = get_post_meta($post->ID, "_key", true); ?>

    This might be a bit more work than you want, but what you could do is use a query posts loop to pull up all of your recent posts and then echo the excerpt, and in the excerpt box for those posts put the definition.

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('showposts=10'.'&paged='.$paged);
    ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    
    <li><?php the_excerpt(); ?></li>
    
    <?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add some text to a sidebar list’ is closed to new replies.