Support

Account

Forum Replies Created

  • ah.. I see..

    I’ll use yours then.. =]

    Thanks for the advise! ^_^

  • Thank you for the suggestion anyway. I’m pretty new in PHP so my code might really seem unsemantic or such. Will work on that ;]

    Thanks! =]

  • Hi!

    Well, it shouldn’t be listed as a “list” as in

      or

        .. I want it listed in one line without touching the css so I coded it that way.. Also, there is a possibility that not all the Doctors will have a “Sub Specialty” that’s why there’s this line of code:

        <?php 
        if (get_field('sub_specialty') != '') { ?>

        I removed the array($terms); too. =]

        Here’s my final code on displaying the term name:

        <?php
            $terms = get_field('sub_specialty');
            foreach ($terms as $term){
                $subspec[] = '<a href="'.$term->slug.'" name="'.$term->slug.'" alt="'.$term->anem.'">'. $term->name .'</a>';
             }
            echo implode(' / ', $subspec);
        ?>
      1. Hi Jonathan!

        I switched the return value to Term Object as your reco but the code did not work. Anyways, I fixed it already and here’s my working code:

        <?php 
        						/* sub specialty */
        						if (get_field('sub_specialty') != '') { ?>
        						<strong>Sub specialty.:</strong>
        						<?php
        $terms = get_field('sub_specialty');
        array($terms);
        foreach ($terms as $term){
        $subspec[] = '<a href="'.$term->slug.'" name="'.$term->slug.'" alt="'.$term->anem.'">'. $term->name .'</a>';
        }
        echo implode(' / ', $subspec);
        ; ?>
        						<br />
        						<?php } else { ?>
        						
        						<?php } ?>

        I added some codes too according to how I want it to be displayed.

        Thanks for replying btw. =]

        God bless!! ;]

      2. Hi! The custom post type is “dims”.. the Departments is a custom taxonomy… =]

        Here is how I want it to be:
        I have a custom post type “Doctors”, each “Doctor” are assigned in different “Department” and has “Sub-Specialty/Specialties”..

        The Sub-Specialty should have the same list as of the Department, so I used the Relationship > Taxonomy of ACF to call the list of “Departments”. It’s working on the back-end, but on the front-end, what being displayed is the Item ID of the “Department” not the Item Name/Value.

        The taxonomy “Departments” is in checbox format.. =]

        Thanks!

      Viewing 5 posts - 1 through 5 (of 5 total)