[resolved] Showing the descriptions (2 posts)

  1. delawaresmith
    Posted 2 years ago #

    I added this to my single.php, but then it shows all author and descriptions on all pages. Same issue as pwocken.

    It's a test site, but you can see it live here - http://www.hereismysite.info/monster-santa/

    <?php //old code here;
           //more old code ();
           //last line of old code;
           //You can add a comment here, to remind you why there is new code below
           $terms = get_terms("byline");
              $count = count($terms);
              if ( $count > 0 ){
                 echo "
                    foreach ( $terms as $term ) {
                         echo "<h6>About " . $term->name . "</h6>";
                         echo "<p>" . $term->description . "</p>";
                  echo "</ul>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]


  2. mattdu
    Plugin Author

    Posted 2 years ago #

    OK, this post revealed a flaw in my previous code.

    Replace this line:
    $terms = get_terms("byline");

    With this line:
    $terms = get_the_terms($post->ID, 'byline');

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Byline
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.