Problem: I would like to use the custom shortcode get_taxonomy_items to display links to hierarchical term archives in a Custom HTML widget, but the term links appear before the widget instead of inside the widget.
Solution: When used in a Custom HTML widget, this custom shortcode must be modified as shown:
/* modifica per categorie personalizzate */ function get_taxonomy_items_func($atts){ extract( shortcode_atts( array( 'taxonomy_name' => '', ), $atts ) ); $args = array( 'taxonomy' => $taxonomy_name, 'hierarchical' => 1, 'title_li'=>0 ); ob_start(); wp_list_categories( $args ); return ob_get_clean(); } add_shortcode('get_taxonomy_items', 'get_taxonomy_items_func');
Then insert this code in the Custom HTML widget:
<ul class="widget_categories"> [get_taxonomy_items taxonomy_name="tribunali"] </ul>
Relevant Documentation: @https://toolset.com/forums/topic/how-to-create-a-view-which-displays-taxonomy-as-proper-indented-hierarchy/#post-368307
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 5 replies, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Christian Cox.