Using Custom Taxonomy

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #8509
    Rob BalucasbabaLucas
    Participant

    I added a custom taxonomy to the portfolio.

    I tried to use the [show_post_snippets] to filter by my custom taxonomy since taxonomy is a parameter available. Any suggestions?

    Here’s the shortcode:
    [show_post_snippets post_type="portfolio" terms="dispositions" taxonomy="contribution" number_of_columns=4 post_count=50 image_size='small' excerpt_count=100 display_text="true" show_excerpt="true" hide_thumbnail="false"]

    #8510
    Rob BalucasbabaLucas
    Participant
    This reply has been marked as private.
    #8519
    RaghavendraRaghavendra
    Moderator

    The theme currently sets the taxonomy for known post types like portfolio and gallery automatically in line number 495 of framework/functions/post-functions.php file. Only for other custom post types, you can set the taxonomy. You can modify (or remove) the line above to specify the taxonomy of your own.

    #8526
    Rob BalucasbabaLucas
    Participant

    That’s great; worked perfectly thank you.

    One last question: I copied that file to the same directory in my /agile-child but it doesn’t work. What am I missing there?

    #8528
    RaghavendraRaghavendra
    Moderator

    Pls override the function mo_get_post_snippets_list($args) in your child theme. You cannot replace the whole file like a template page in the root theme directory.

    #26569
    Rob BalucasbabaLucas
    Participant

    I’m once again having this issue in version 4.1 of the theme.

    Trying to use this shortcode:

    [show_post_snippets terms=”acquisition” taxonomy=”contribution” post_type=”portfolio” number_of_columns=4 post_count=8 image_size=’medium’]

    #26580
    RaghavendraRaghavendra
    Moderator

    Can I get a temp access so that I can take a closer look at your change you have in your child theme to make this work? Thank you.

    #26583
    Rob BalucasbabaLucas
    Participant
    This reply has been marked as private.
    #26608
    RaghavendraRaghavendra
    Moderator
    This reply has been marked as private.
    #26621
    Rob BalucasbabaLucas
    Participant
    This reply has been marked as private.
    #26629
    RaghavendraRaghavendra
    Moderator

    I added this piece of code in your child theme functions.php –

    
    if (!function_exists('mo_get_taxonomy')) {
        function mo_get_taxonomy($post_type) {
    
            $taxonomy = 'category';
    
            if ($post_type == 'portfolio')
                $taxonomy = 'contribution';
            elseif ($post_type == 'gallery_item')
                $taxonomy = 'gallery_category';
            elseif ($post_type == 'post')
                $taxonomy = 'category';
    
            return $taxonomy;
        }
    }
    

    It did not work for some reason. Then I changed the parameter from taxonomy to taxonamy (the earlier versions of the theme had this typo) and things are working due to a backwards compatibility code I had in place to accommodate older versions of the theme. Pls check. I have removed the above code.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.