Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:44:18+00:00 2026-06-01T20:44:18+00:00

Having problems solving a basic (but new to me) custom taxonomy issue–I have used

  • 0

Having problems solving a basic (but new to me) custom taxonomy issue–I have used the
get_the_category() function quite a bit in my theme. Namely as a “search and replace” if you will

foreach((get_the_category()) as $category) pulls the category of “state” and is used:

/images/States/’ . $category->cat_name . ‘.png
(category= colorado, then it pulls colorado.png)

Easy. Great. but….I would like to do this same thing with a custom taxonomy but can’t figure out how to get it to work.

I have a Custom Post Type of “City Pages” (city_pages)
For those pages I have created a taxonomy of “State” (state)
(these have to be different than the “categories” of state)

I have looked, I have researched and I cannot figure out how to do this. I know there are similar questions/problems out there but I have not been able to put 2 and 2 together in order to get this to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:44:19+00:00Added an answer on June 1, 2026 at 8:44 pm

    I think this is what you want: http://codex.wordpress.org/Function_Reference/get_terms

    So it woud be something along the lines of:

    <?php
        $states = get_terms( 'state' );
        foreach( $states as $state ) {
            echo '<img src="./images/States/' . $state->name . '.png">'; 
        }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having problems with classpaths. I have used them before with import but I'm
I am having great problems solving this one: I have a mysql database encoding
I have recently started having problems with TortoiseCVS, or more specifically with plink, the
I'm having trouble solving this problem. I have to find all simple paths starting
I have just started reading a C++ textbook and I am having trouble solving
I was solving a question, with which I am having some problems: Complete the
I'm having a bit of an issue solving a jQuery form problem. Basically I
I'm having trouble solving this problem: Create a function that given a character set
Hi I am having an issue solving a problem that I need to resolve
I was practising the algorithm based programming problem.I am having difficulty,in solving this problem.I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.