If you want to use the groups created with the Tag Groups plugin, you you have to use it when you create the output. Your code just seems to retrieve all terms of a post.
If you want to use the groups created with the Tag Groups plugin, you also have to use it when you create the output. Your code just seems to retrieve all terms of a post.
I use the
<?php if ( function_exists( ‘tag_groups_cloud’ ) ) echo tag_groups_cloud( array( ‘include’ => ‘1,2,3,4,5’ ) ); ?>
code, to show the Tag Groups and taxonomies, but it shows all Taggroups (which is good) and all taxonomies (which is not good) because i want to show only the relevant taxonomies which are assigned to this post.
Is it possible to set some kind of filter in the php statement . Something like :
<?php if (get_the_terms($post->ID, ‘features’)) {
$taxonomy = get_the_terms($post->ID, ‘features’);
foreach ($taxonomy as $taxonomy_term) {
THX
For the time being you will probably need to retrieve the array and filter out tags that are not assigned to the post. There is a future version in the making that will offer the option to display only tags that are connected to one post. Just needs some more testing.
… or you check the latest version. 🙂
I installed the latest version 0.10. In my PHP file i use the code:
<?php if ( function_exists( ‘tag_groups_cloud’ ) ) echo tag_groups_cloud( array( ‘include’ => ‘1,2,3,4,5’ ) ); ?>, because i have 5 Tag-groups and i want all taxonomies which are related to the current post.
It still displays all taggroups and all taxonomies. How can i set the filter in the PHP code to only see the groups and taxonomies for the current post?
THX Freek
Your code looks like you have not yet added the required parameters.
You could try:
echo tag_groups_cloud( array( 'include' => '1,2,3,4,5', 'tags_post_id' => 0, 'hide_empty_tabs' => 1 ) );
The taxonomy is always the one that you have chosen in the settings.
One more thing: Since you use ‘include’, the tag groups with IDs 1 to 5 will always be displayed. It would make more sense to omit the 'include' => '1,2,3,4,5', part.
Super! Thanks. It works!
One final question:
How about formatting? I want all results displayed in two rows with a bullet before every item like this:
* option 1 * option 2
* option 3 * option 4
etc..
THX again
Freek
You could try to add to your css something like
.ui-tabs-panel a { … }
where you define a background image for the bullets and create columns according to http://www.w3schools.com/css3/css3_multiple_columns.asp
If you want to output the tags as table, you probably won’t avoid retrieving the tags as an array and then creating your cloud from scratch. This may help you: http://www.christoph-amthor.de/software/tag-groups/examples-applications/#Display_tags_in_columns
Thanks again. In the themeroller setup i can change some things as tag cloud colors, font settings etc.. Also there is a section with framework icons. Is it possible to show an icon as separator? Now i use the following code:
<?php if ( function_exists( ‘tag_groups_cloud’ ) ) echo tag_groups_cloud( array( ‘include’ => ‘1,2,3,4,5’, ‘tags_post_id’ => 0, ‘hide_empty_tabs’ => 1, ‘smallest’ => 12, ‘largest’ => 12, ‘separator’ => “✪”, ‘separator_size’ => 18 ) ); ?>
I want to use an other separator. Is it possible?
THX
Freek
You can choose the separator via the parameters. I cannot answer questions about the theme roller or customizations. The styling options assume that you are familiar with css and that stuff. If not, there are many instructions on the web, just google it.
Thanks for your support. I appreciate it very much.
Case closed!
Freek