Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Gareth Lockett

Forum Replies Created

Viewing 6 posts - 21 through 26 (of 26 total)
  • Gareth Lockett in reply to:
    Category Description
    #122385
    This reply has been marked as private.
    Gareth Lockett in reply to:
    Category Description
    #122379

    I’m not sure I follow you. I’m only trying to get the category description at the moment, not the tag description. How does that relate to errant 1?

    Gareth Lockett in reply to:
    Category Description
    #122375
    Array
    (
    )
    1
    Gareth Lockett in reply to:
    Category Description
    #122367

    Yes, it’s inside the tag.

    Gareth Lockett in reply to:
    Category Description
    #122357

    I get the following (you can see a 1 at the end of the array):

    Array
    (
        [_sft_project_category] => Array
            (
                [name] => Product Categories
                [singular_name] => Product Category
                [all_items_label] => All Categories
                [type] => taxonomy
                [active_terms] => Array
                    (
                        [0] => Array
                            (
                                [id] => 6
                                [name] => Fruit
                                [value] => fruit
                                [count] => 7
                            )
    
                    )
    
            )
    
        [_sft_project_tag] => Array
            (
                [name] => Product Tags
                [singular_name] => Product Tag
                [all_items_label] => All Tags
                [type] => taxonomy
                [active_terms] => Array
                    (
                        [0] => Array
                            (
                                [id] => 8
                                [name] => 6+ Months
                                [value] => 6-months
                                [count] => 11
                            )
    
                    )
    
            )
    
    )
    1
    Gareth Lockett in reply to:
    Category Description
    #122324

    Okay I’ve worked out how to obtain the ID and get the description but the ID has an extra 1 at the end of the string which I’ve had to strip off.

    Can you see why it would have the extra one and how to avoid it?

    Thanks

    		<?php global $searchandfilter;
    			$sf_current_query = $searchandfilter->get(119)->current_query()->get_array();
    			$currentCat = $sf_current_query['_sft_project_category']['active_terms'][0]['id'];
    			$currentCatID = rtrim($currentCat,'1');
    			echo category_description( $currentCatID );
    		 ?>
Viewing 6 posts - 21 through 26 (of 26 total)