[resolved] widget customization (4 posts)

  1. yoshid
    Posted 3 years ago #

    hi everyone,

    I have a wp template I am using for one of my projects. I'm having some issues customizing one of the widget.
    basically, the widget displays the post title, author and category. what I am trying to do is to have the widget show part of the actual post, a few lines at least.
    here is the piece of code I'm trying to modify:

    <?php the_title(); ?>
    <p class="meta-info">
    <?php esc_html_e('Posted','Lucid'); ?>
    <?php esc_html_e('by','Lucid');?>
    <?php echo get_the_category_list(', '); ?>
    <?php esc_html_e('in','Lucid'); ?>
    <?php echo get_the_category_list(', '); ?>

    is there a line of code I can add here to have part of my post show up in the widget? I tried adding: <?php the_post(); ?> but it kills the page entirely.

    any help would be greatly appreciate it. thanks in advance.
    yoshi /

  2. Amy Hendrix (sabreuse)

    Posted 3 years ago #

    try <?php the_excerpt(); ?> instead. the_post() doesn't do what you're thinking it does.

  3. yoshid
    Posted 3 years ago #

    whoowhooo, that's the ticket.
    many thanks amy, much appreciated!
    p /

  4. Amy Hendrix (sabreuse)

    Posted 3 years ago #

    You're welcome! I'm glad it worked for you.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.