-
AuthorPosts
-
January 29, 2015 at 7:03 am #387541
Hi,
Is there a way to add custom post types and taxonomies (with parent and child categories) to sidebar widgets?
Thanks
January 29, 2015 at 6:15 pm #387855Hey senso!
Are you trying to display links to some custom post type categories and taxonomies? You can use the “Custom Menu” widget and create a menu in Dashboard > Appearance > Menus for this.
Cheers!
ElliottJanuary 30, 2015 at 3:59 am #388097Hi Elliott,
Thanks for the prompt support. I have many custom post type categories and taxonomies with parents and childs. I’m not sure if is ok to manually create custom menu for each. Its like I may have to create up to 100s custom menus… and growing.
When I use the default post type PAGE, it automatically shows the category and sub categories on the sidebar. I would like to do something like that for custom post types and taxonomies. Is there a way to do it?
February 1, 2015 at 8:13 am #388959Hey!
You don’t need to create custom menu for each custom post type. Create a menu on Appearance > Menus then add the custom post type links there. Now, go to Appearance > Widgets, add the Custom Menu widget. Select the newly created menu with the custom post type links.
Best regards,
IsmaelFebruary 2, 2015 at 10:02 am #389217Thanks Ismael and Elliot,
For example:
Brand A has 5 products range.
Each range has 20-30 products.
Hence the hierarchy is<strong>Brand A</strong> PRODUCT RANGE ONE - Product type 1 - Product A - Product B - Product C - and the list go on - Product type 2 - Product AA - Product BB - Product CC - and the list go on - Product type 3 - Product AAA - Product BBB - Product CCC - and the list go on PRODUCT RANGE TWO - Product type 1 - Product A - Product B - Product C - and the list go on - Product type 2 - Product AA - Product BB - Product CC - and the list go on - Product type 3 - Product AAA - Product BBB - Product CCC - and the list go on
When Product A is viewed, the sidebar will show
<strong>Brand A</strong> PRODUCT RANGE ONE PRODUCT RANGE TWO PRODUCT RANGE THREE
Lets assumed there many brands. It seems I have to create many custom menus for different Brands in order to show the relevant products ranges?
February 2, 2015 at 10:49 pm #389717Hi!
You could use this function, http://codex.wordpress.org/Function_Reference/get_taxonomies, to grab the terms and display them (there are code examples in the bottom of the page).
But I think it would actually be easier to use the custom menu widget and drag the categories over to menus that you create.
Cheers!
ElliottFebruary 3, 2015 at 1:36 am #389803Hi Elliot,
I’ve tried. Neither solution works. I think it is just not possible to do it on a sidebar. Thanks. -
AuthorPosts
- The topic ‘Adding custom post types and taxonomies to sidebar widgets’ is closed to new replies.