Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Problem with the taxonomies I made

Viewing 5 posts - 1 through 5 (of 5 total)
  • michele sann
    #208829

    Hi Trevon, I have a problem with the taxonomies I made.
    I would like them to appear when I select an article, but I don’t know how.

    I’ll give you an example to better understand.
    If you go on this article: http://sito.oenoa.it/se-toccate-il-mio-tasto-sbagliato/#toccate-tasto-sbagliato/page1
    above, the date appears (August 20, 2009), but there are no my taxonomies, why? what can I do?

    Thanks, Michele

    Trevor Moderator
    #208913

    My apologies for the delay in replying. In the UK we have had a long 4 day national holiday weekend this last weekend.

    To your question. For example, argomenti?

    Did you make a custom version of the results.php file, as detailed here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    It will require some custom code in that file, in the location/line where you want the terms output. For example, for argomenti, it would be something like this (but you can add your own HTML and classes etc):

    $taxonomy_terms = get_terms('argomenti');
    foreach($taxonomy_terms as $term){
      $terms[] = $term->name;
    }
    if(!empty($terms)) {
      echo join(", ", $terms);
      unset ($terms);
    }
    michele sann
    #209249

    Hello,
    I did as you explained and entered the code you gave me, but, all the taxonomies of “ARGOMENTI” that I entered appear … while only the selected ones should appear.

    I don’t know if I entered the code in the right place.

    			<p><?php the_category(); ?></p>
    			<p><?php the_tags(); ?></p>
    			<p><small><?php the_date(); ?></small></p>
    			
    			<?php
    			$taxonomy_terms = get_terms('argomenti');
    			foreach($taxonomy_terms as $term){
    			$terms[] = $term->name;
    			}
    			if(!empty($terms)) {
    			echo join(", ", $terms);
    			unset ($terms);
    			}
    			?>
    
    michele sann
    #209251
    This reply has been marked as private.
    Trevor Moderator
    #209344

    It might need to be this then:

    $taxonomy_terms = wp_get_post_terms(get_the_ID(),'argomenti');
    foreach($taxonomy_terms as $term){
      $terms[] = $term->name;
    }
    if(!empty($terms)) {
      echo join(", ", $terms);
      unset ($terms);
    }
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.