WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Query help (3 posts)

  1. haussamen
    Member
    Posted 1 year ago #

    Hi,

    I've created a special taxonomy called "Article top tagline" to allow me to put a tagline above the headline on posts on my site. Here's the code I'm using:

    <?php $terms_as_text = strip_tags( get_the_term_list( $wp_query->post->ID, 'article_top_tagline', '', ', ', '' ) ); echo $terms_as_text;?>

    The problem is, it shows the same tagline each time. In other words, even though posts have different taglines such as "from our blog" and "news about us," it shows "News about us" each time and never any of the others. What's wrong with my code?

    Thanks.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    Try replacing '$wp_query->post->ID' with '$post->ID'.

  3. haussamen
    Member
    Posted 1 year ago #

    That did it. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic