Problem with the taxonomies I made

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

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #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
    #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);
    }
    Anonymous
    #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);
    			}
    			?>
    
    Anonymous
    #209251
    This reply has been marked as private.
    Trevor
    #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)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.