Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom taxonomy #33

Closed
tblobaum opened this issue Jun 27, 2023 · 3 comments
Closed

Custom taxonomy #33

tblobaum opened this issue Jun 27, 2023 · 3 comments

Comments

@tblobaum
Copy link

How do i add a custom taxonomy to a post.

For example, my post has one to many tags, one to many categories, and one publisher. The custom taxonomy publisher is a clone of the category type.

@vaakash
Copy link
Owner

vaakash commented Jun 28, 2023

Hi @tblobaum,

You can add custom taxonomy like below.
https://www.aakashweb.com/docs/git-it-write/writing-posts/#setting-post-properties-like-post-title-tags-custom-fields-etc

---
title: Title of the post
menu_order: 1
post_status: publish
post_excerpt: This is a post excerpt
featured_image: _images/post-image.jpg
taxonomy:
    category:
        - category-slug-1
        - category-slug-2
    post_tag:
        - tag-1
        - tag-2
custom_fields:
    field1: value 1
    field2: value 2

---

## My post content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a lacinia orci.
Nunc sodales massa enim, nec consectetur orci tempus ac.

Thanks,
Aakash

@tblobaum
Copy link
Author

---
title: Title of the post
menu_order: 1
post_status: publish
post_excerpt: This is a post excerpt
featured_image: _images/post-image.jpg
taxonomy:
    category:
        - category-slug-1
        - category-slug-2
    post_tag:
        - tag-1
        - tag-2
    publisher:
        - publisher-1
custom_fields:
    field1: value 1
    field2: value 2

---

## My post content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a lacinia orci.
Nunc sodales massa enim, nec consectetur orci tempus ac.

Is this correct?

@vaakash
Copy link
Owner

vaakash commented Jun 29, 2023

---
title: Title of the post
menu_order: 1
post_status: publish
post_excerpt: This is a post excerpt
featured_image: _images/post-image.jpg
taxonomy:
    category:
        - category-slug-1
        - category-slug-2
    post_tag:
        - tag-1
        - tag-2
    publisher:
        - publisher-1
custom_fields:
    field1: value 1
    field2: value 2

---

## My post content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a lacinia orci.
Nunc sodales massa enim, nec consectetur orci tempus ac.

Is this correct?

Hi @tblobaum, Yes, this will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants