|
Maintain the taxonomy hierarchy in a
Started by: pierreV-2
in: Types Community Support
Quick solution available
Problem:
How to get a hierarchical view of taxonomy, when inserting [wpv-post-taxonomy type="xyz"] into a Visual Editor Cell or inside a View.
Solution:
1. You would need to create a custom shortcode for this purpose (e.g. [display_post_tax_terms_hierarchical] )
Please add the following code in your theme’s functions.php file:
/**
* Display taxonomy terms in hierarchical order.
*
* Advised by WP Types - Toolset
*/
function list_hierarchical_terms($atts) {
global $post;
$taxonomy = $atts['taxonomy_name'];
$separator = $atts['separator'];
$terms = wp_get_object_terms( $post->ID, $taxonomy, array( "fields" => "ids" , "orderby" => "term_id") );
if( $terms ) {
$terms = trim( implode( ',', (array) $terms ), ' ,' );
$output = wp_list_categories( 'title_li=&taxonomy=' . $taxonomy . '&include=' . $terms."&hierarchical=1"."&separator=".$separator."&echo=0&style=none&order=DESC");
$output = substr(trim($output), 0, -1);
$str_array = explode($separator, $output);
if(isset($str_array) && count($str_array)) {
$str_array_rev = array_reverse( $str_array );
$output = implode($separator,$str_array_rev);
}
return $output;
}
}
add_shortcode( 'display_post_tax_terms_hierarchical', 'list_hierarchical_terms' );
2. Then, add the below shortcode in Visual Editor cell or in a View or Content template:
[display_post_tax_terms_hierarchical taxonomy_name="location" separator=","]
Another solution: https://toolset.com/forums/topic/display-wpv-post-taxonomy-and-hierarchical-taxonomies/#post-410285
|
|
2 |
13 |
7 years, 6 months ago
pierreV-2
|
|
setting up a pdf catalogue with ajax
Started by: timC-7
in: Types Community Support
Quick solution available
Problem: I would like to use Views to display PDFs on my site. PDFs are organized into Category and SubCategory, and I would like to use a custom interface to filter my PDFs using link-style buttons.
Solution: Views isn't designed to display the contents of PDFs well. This will probably require a 3rd-party plugin solution.
Views is designed to allow users to filter results based on standard form input controls, like select dropdowns, checkboxes, radio buttons, and text inputs. Customizing those inputs to look like basic text links would require some custom CSS and HTML, which falls outside the scope of the support we can provide here in the forum.
What I could help with here is an alternative approach that uses standard form elements and downloadable PDF links.
|
|
2 |
3 |
7 years, 7 months ago
timC-7
|
|
Full screen slider
Started by: johanL-2
in: Types Community Support
Quick solution available
|
|
2 |
23 |
7 years, 7 months ago
johanL-2
|