List of all Custom Taxonomy terms?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tittytweaker
    Confirmed User
    • Dec 2012
    • 184

    #1

    List of all Custom Taxonomy terms?

    I have a custom taxonomy called "Model" on my wordpress blog. I'd like to be able to create a functional "Browse by model" page on my site. I need to be able to just get a complete list of every term that is in that taxonomy and list it on one page. I've tried googling it, like always, but it's all Greek to me.

    I'd like it to auto-update every time a new term is added, as well as have it listed alphabetically, with perhaps a column for every letter. Is there a plugin that can accomplish this?

    Thanks in advance,
    ~TT
    www.tittytweaker.com
  • Miguel T
    ♦ Web Developer ♦
    • May 2005
    • 12470

    #2
    Code:
     $terms = get_terms("my_taxonomy");
     $count = count($terms);
     if ( $count > 0 ){
         echo "<ul>";
         foreach ( $terms as $term ) {
           echo "<li>" . $term->name . "</li>";
            
         }
         echo "</ul>";
     }

    Full Stack Webdeveloper: HTML5/CSS3, jQuery, AJAX, ElevatedX, NATS, MechBunny, Wordpress

    Comment

    • Tittytweaker
      Confirmed User
      • Dec 2012
      • 184

      #3
      Sorry, I guess I still don't get it. I saw this when Googling around trying to find an answer as well but never found a satisfying answer as to how to implement it.

      What exactly am I supposed to do with this? I'm trying to get it on this page:

      http://www.tittytweaker.com/browse-by-model/

      But pasting it in there just shows the code, and not the list.
      www.tittytweaker.com

      Comment

      • Kostly
        Confirmed User
        • Oct 2011
        • 474

        #4
        Create a simple module or plugin or whatever word press calls it
        Slippery Onion - Upload Images for Free Backlinks
        Our Kinky Life - Our Adult Sites

        Comment

        • Tittytweaker
          Confirmed User
          • Dec 2012
          • 184

          #5
          Unfortunately I don't have the ability to do that, which is why I'm asking. I was hoping there was a way to do it with an existing plugin or chunk of code that way I don't have to go through and manually create hyperlinks for every term.
          www.tittytweaker.com

          Comment

          • sarettah
            see you later, I'm gone
            • Oct 2002
            • 14330

            #6
            You put what was posted above into php tags and then change your term name and it should work. (I think )


            <?php

            $terms = get_terms("model");
            $count = count($terms);
            if ( $count > 0 ){
            echo "<ul>";
            foreach ( $terms as $term ) {
            echo "<li>" . $term->name . "</li>";

            }
            echo "</ul>";
            }

            ?>
            Last edited by sarettah; 02-23-2013, 11:52 AM.
            All cookies cleared!

            Comment

            • Tittytweaker
              Confirmed User
              • Dec 2012
              • 184

              #7
              Installed a plugin to enable PHP in the posts and pages called PHP Execution. I've got a list now, but is there any way to make them clickable?
              www.tittytweaker.com

              Comment

              • sarettah
                see you later, I'm gone
                • Oct 2002
                • 14330

                #8
                I think you do this, not sure if there is a better way.

                <?php

                $terms = get_terms("model");
                $count = count($terms);
                if ( $count > 0 ){
                echo "<ul>";
                foreach ( $terms as $term ) {
                echo '<li><a href="' . get_term_link($term) . '">'. $term->name . '</a></li>';

                }
                echo "</ul>";
                }

                ?>
                All cookies cleared!

                Comment

                • sarettah
                  see you later, I'm gone
                  • Oct 2002
                  • 14330

                  #9
                  Originally posted by Tittytweaker
                  Installed a plugin to enable PHP in the posts and pages called PHP Execution. I've got a list now, but is there any way to make them clickable?
                  You should not have had to install a plugin.

                  .
                  All cookies cleared!

                  Comment

                  Working...