0

Everything works except tag description. Could you help?

<?php while($my_Property->have_posts()) : $my_Property->the_post(); ?>
    <div class="ListaP" style="width:32%; display: inline-block;">
        <div class="Lista">
            <h4><?php the_title(''); ?></h4>
            <div class="thumbnail lista"
            <p class="propertyID" style="font-weight:600;">ID: <?php $post_url = get_the_ID($post_id); echo $post_url; ?></p>
            <p class="opisOdAgenta">ADRES: <?php the_field('deal_title'); ?></p>
            <p class="adresAgent">NOTATKI/UWAGI/: <?php the_field('deal_detail'); ?></p>
            <p class="klientWlasciciel">KTO PROWADZI: <?php the_author(); ?></p> 
            <p class="klientWlasciciel">WLASCICIEL: <?php echo 'Tag Description: ' . tag_description($tag_id); ?> </p>  //DOESNT WORK
            </div>

        </div>

    </div>
<?php endwhile;?>
  • what are your query parameters? – Michael Dec 15 '17 at 22:31
  • Michal did the answer below solve your problem? – jdm2112 Feb 23 '18 at 20:43
0

Your $tag_id variable is not defined before use. Try a test with a fixed value in there:

<p class="klientWlasciciel">WLASCICIEL: <?php echo 'Tag Description: ' . tag_description( '1' ); ?> </p>

... or test the default behavior which should be the current queried tag:

<p class="klientWlasciciel">WLASCICIEL: <?php echo 'Tag Description: ' . tag_description(); ?> </p>

https://codex.wordpress.org/Function_Reference/tag_description

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.