Format Tag list and Category list as column

This topic contains 7 replies, has 3 voices, and was last updated by  Paolo 7 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #314524

    Christina Morris
    Expired Member
    Post count: 53

    Hey all, where do I find the template to alter the tag and category list? I would like to format it so that it is a bulleted list rather that a comma separated one.
    Thanks in advance!

    PS I mean on the detail pages in case that wasn’t apparent!

    #314854

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the only way I see to do this is quite complex. The template calls that as an action, so there is really no template to modify, what needs to be modified are functions (a couple of them), I asked to the developers to let us know if there is any easier way and possibly to provide an example.

    Thanks

    #314942

    Christina Morris
    Expired Member
    Post count: 53

    Thanks, I would appreciate anything you can do.
    I thought of adding another field that I could make a bulleted list and just not using the tags, but the built in search for tags could be very useful for us.

    Again, thanks for your time!

    Christina

    #315388

    Giri
    Expired Member
    Post count: 3155

    Hi Christina,

    Try this code in your child theme’s functions.php file.

    
    
    
    add_filter('geodir_details_taxonomies_output', 'geodir_details_taxonomies_output_as_ul', 10, 4);
    function geodir_details_taxonomies_output_as_ul($taxonomies, $post_type,$listing_label, $listing_label_uc) {
        if (!geodir_is_page('detail')) {
            return $taxonomies;
        }
        $post_taxonomy = $post_type . 'category';
        if (isset($taxonomies[$post_taxonomy])) {
            $cats = str_replace(__("$listing_label_uc Category:", 'geodirectory'), '', $taxonomies[$post_taxonomy]);
            $cats = str_replace("</a> and <a", "</a>,<a", $cats);
            $cats = explode(',', $cats);
            $output = "";
            if ($cats) {
                $output .= "<ul class='gd_tax_cat_ul'>";
                foreach ($cats as $cat) {
                    $output .= "<li>$cat</li>";
                }
                $output .= "</ul>";
            }
            $taxonomies[$post_taxonomy] = $output;
        }
    
        if (isset($taxonomies[$post_type . '_tags'])) {
            $cats = str_replace(__("$listing_label_uc Tags:", 'geodirectory'), '', $taxonomies[$post_type . '_tags']);
            $cats = str_replace("</a> and <a", "</a>,<a", $cats);
            $cats = explode(',', $cats);
            $output = "";
            if ($cats) {
                $output .= "<ul class='gd_tax_tags_ul'>";
                foreach ($cats as $cat) {
                    $output .= "<li>$cat</li>";
                }
                $output .= "</ul>";
            }
            $taxonomies[$post_type . '_tags'] = $output;
        }
        return $taxonomies;
    }

    Let me know how that goes.

    Thanks

    #315938

    Christina Morris
    Expired Member
    Post count: 53

    THANK YOU! you are genuis!
    http://www.seniorcomfortguide.com/wordpress/senior-living/assisted-living/gateway-family-house/

    that’s what it looks like!

    Again, Thank you!!

    #315949

    Paolo
    Site Admin
    Post count: 31206
    This reply has been marked as private.
    #315951

    Christina Morris
    Expired Member
    Post count: 53

    Will any of you be at WordCamp this weekend?

    #315955

    Paolo
    Site Admin
    Post count: 31206

    Not this time… we sponsored NY WordCamp back in July and it was quite a big expense for us.

    Next year we will try to be present at more than one, maybe a couple.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket