liatG
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Center the woo-buy-option button
Started by: liatG in: Toolset Professional Support |
2 | 3 | 6 years ago | ||
Change Custom Taxonomy slug to force desired URL structure, update affected code
Started by: liatG in: Toolset Professional Support |
2 | 5 | 6 years, 1 month ago | ||
Unexpected behavior: List items shown in a View lose font formatting
Started by: liatG in: Toolset Professional Support |
1 | 2 | 6 years, 1 month ago | ||
Limit term page navigation to within the 2nd level term
Started by: liatG
in: Toolset Professional Support
Problem: I am using a View of taxonomy terms ordered by custom field value to show links to the next and previous term archives. I would like to filter those Views by term grandparent, so that only terms in the same grandparent are included in the results. Solution: There is no term grandparent filter, so you can use another custom field in the Class Parts taxonomy. For each class, use a different field value. So for Knitting Superstar and all its descendant terms, use "knitting-superstar". For Fearless Knitter and all its descendant terms, use "fearless-knitter", etc. Then add a filter to the Next and Previous Views that filters by this custom field, set by a shortcode attribute. In the View shortcodes for the Next and Previous View, use a Types termmeta shortcode to insert the current term archive's custom field value in a shortcode attribute. Relevant Documentation: |
2 | 4 | 6 years, 1 month ago | ||
Display custom taxonomy field contents in a taxonomy archive
Started by: liatG
in: Toolset Professional Support
Problem: I would like to display a term field in a term archive. Solution: Use the Fields and Views button to insert a custom term field in your Layout or WordPress Archive. [types termmeta="my-text-field"][/types] Relevant Documentation: |
2 | 3 | 6 years, 1 month ago | ||
Get the slug of the grandparent of the taxonomy archive
Started by: liatG
in: Toolset Professional Support
Problem: I would like to be able to get the slug or ID of a taxonomy term ancestor of the current taxonomy archive term. Solution: Use a custom shortcode to return either an ID or a slug: function n_level_term_func($atts) { $a = shortcode_atts( array( 'n' => '0', 'format'=>'id', ), $atts ); $current_taxonomy = get_queried_object()->taxonomy; $id = 0; $slug = ''; if( $current_taxonomy == 'class-part' ) { $ancestors = get_ancestors( get_queried_object()->term_id, $current_taxonomy ); $count = count( $ancestors ); $id = isset( $ancestors[ $count - $a['n'] ] ) ? $ancestors[ $count - $a['n']] : get_queried_object()->term_id; $term= get_term( $id, $current_taxonomy); $slug = isset($term->slug) ? $term->slug: $slug; } return $a['format']=='slug' ? $slug : $id; } add_shortcode("n-level-term", "n_level_term_func"); Then you can use the "format" attribute to specify if you want a "slug". Otherwise, an "id" will be returned: Slug: [n-level-term n="2" format="slug"]<br /> ID: [n-level-term n="2"]<br /> You may have to re-register the new shortcode name in Toolset > Settings > Front-end content. |
2 | 4 | 6 years, 1 month ago | ||
Rewriting taxonomy slug as / breaks site
Started by: liatG in: Toolset Professional Support |
2 | 4 | 6 years, 1 month ago | ||
Dynamically format taxonomy term in view based on current taxonomy archive
Started by: liatG in: Toolset Professional Support |
2 | 3 | 6 years, 1 month ago | ||
Use nested view term as a link in higher level view loop
Started by: liatG in: Toolset Professional Support |
1 | 2 | 6 years, 1 month ago | ||
Display a custom taxonomy field in a taxonomy archive
Started by: liatG in: Toolset Professional Support |
1 | 2 | 6 years, 1 month ago | ||
Help setting up “term pagination” in term archive pages.
Started by: liatG
in: Toolset Professional Support
Problem: I am using term archives to display posts without pagination, and I would like to create Next and Previous links to paginate to another term archive page. The sort order should be determined by a custom field on the terms. Solution: function archive_part_num_func($atts) { $current_taxonomy = isset(get_queried_object()->taxonomy) ? get_queried_object()->taxonomy : null; if( $current_taxonomy == 'class-part' ) { $id = get_queried_object()->term_id; $partnum = types_render_termmeta( 'part-order', array('term_id'=>$id)); return $partnum; } return; } add_shortcode("archive-part-num", "archive_part_num_func"); Add to the View filter like this: <p>← Previous: [wpv-view name="class-parts-filtered-by-part-order-previous" partnum="[archive-part-num]"]</p> <p>→ Next: [wpv-view name="class-parts-filtered-by-part-order-next" partnum="[archive-part-num]"]</p> Register "archive-part-num" in Toolset > Settings > Front-end content > Third party shortcode arguments. Relevant Documentation: |
4 | 12 | 6 years, 1 month ago | ||
Gateway Timeout When Trying To Access Toolset Settings Page
Started by: liatG in: Toolset Professional Support |
2 | 10 | 6 years, 1 month ago | ||
Display first children of taxonomy term on Archive page
Started by: liatG
in: Toolset Professional Support
Problem: I created a view to try to show the taxonomy terms with a parent that is the archive shown, but nothing shows. Solution: The problem is in taxonomy view: in section "Query Filter", there is another extra filter: In your case, it is not needed, you can remove it and test again. Relevant Documentation: |
2 | 4 | 6 years, 2 months ago | ||
Help creating a nested view of taxonomy terms to display on archive page sidebar
1
2
Started by: liatG
in: Toolset Professional Support
Problem: I would like to create a hierarchical menu of taxonomy term links. Solution: Use multiple nested Views of this taxonomy. Filter these Views by term ID or term parent, and output the term links and/or another nested View in each Loop. function n_level_term_id_func($atts) { $a = shortcode_atts( array( 'n' => '0' ), $atts ); $id = 0; $current_taxonomy = isset(get_queried_object()->taxonomy) ? get_queried_object()->taxonomy : null; if( $current_taxonomy == 'book-tax' ) { $ancestors = get_ancestors( get_queried_object()->term_id, $current_taxonomy ); $count = count( $ancestors ); $id = isset( $ancestors[ $count - $a['n'] ] ) ? $ancestors[ $count - $a['n']] : get_queried_object()->term_id; } return $id; } add_shortcode("n-level-term-id", "n_level_term_id_func"); Register this shortcode in third-party shortcode arguments, then you can use it as a term ID filter for any View: [wpv-view name="your-view-slug" terms="[n-level-term-id n='2']"] Relevant Documentation: |
4 | 21 | 6 years, 2 months ago | ||
Create a custom Layout just for one specific level of hierarchy in a taxonomy
Started by: liatG
in: Toolset Professional Support
Problem: I would like to apply a different Layout to my custom taxonomy archives depending on the hierarchical level of the term. Solution: Use custom code to programmatically select a specific Layout for each hierarchical level: function apply_layout_by_archive_term_hierarchy( $id, $layout ){ // all the taxonomy slugs that should use these hierarchical layouts $taxonomies = array( 'your-custom-taxonomy' ); // the layout IDs for each level of hierarchy, separated by a comma $layouts = array( 123, 456, 456, 789 ); // --------------------------------------------------- // you should not edit anything below // --------------------------------------------------- $layout_to_apply = $id; $current_taxonomy = isset(get_queried_object()->taxonomy) ? get_queried_object()->taxonomy : null; // test for the correct taxonomy archive if( !$current_taxonomy || !in_array( $current_taxonomy, $taxonomies) ) return $layout_to_apply; // find the hierarchical term level and apply the corresponding layout $current_term_level = get_tax_level(get_queried_object()->term_id, $current_taxonomy); if( isset( $layouts[$current_term_level])){ return $layouts[$current_term_level]; } // fallback to original layout return $layout_to_apply; } add_filter('get_layout_id_for_render', 'apply_layout_by_archive_term_hierarchy', 10, 2); function get_tax_level($id, $tax){ $ancestors = get_ancestors($id, $tax); return count($ancestors); } |
3 | 6 | 6 years, 2 months ago |