<select>
field and then display content from that post based on if it is selected
Pull posts from a CPT into a - This example is showing a list of insurance companies and which states they cover
- The content is pulled from a CPT called
insurance_company
. That CPT has a taxonomy calledstate
. Using Loops & Logic, we will output a<select>
containing the insurance companies. - Next to that, we will output a list of divs, one for each insurance company with their corresponding covered States.
- Then with the JS, we will hide all those divs, leaving an instructional div showing when nothing is selected. When an insurance company is selected, we will find the matching div and display it.