Avada Forums Community Forum PHP error when using $post->ID, ‘portfolio_tags’ and $post->ID, ‘tags’

Viewing 1 post (of 1 total)
  • Author
  • Polka
    Post count: 3

    Hi there!

    I’m new in this forum, and three month using Avada.

    I have a problem using this in functions.php:

    $variable1 = get_the_term_list( $post->ID, 'portfolio_tags', '', '', ', ' );

    In WordPress debug mode I get this:

    Notice: Trying to get property ‘ID’ of non-object in /home/cursom1/public_html/wp-content/themes/Avada-Child-Theme/functions.php on line 27

    In the other hand, when I change taxonomy to “tags” nothing happens:

    $variable2 = get_the_term_list( $post->ID, 'tags' );

    What I’m doing wrong?

    Thank you for reading!

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.