Title: PHP example from Front End page does not work
Last modified: October 22, 2020

---

# PHP example from Front End page does not work

 *  Resolved [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/)
 * I have copied the link exactly as is on the Front End page of the plugin into
   my sidebar.php file:
 * <?php if ( function_exists( ‘tag_groups_cloud’ ) ) echo tag_groups_cloud( array(‘
   include’ => ‘1,2,5,6’ ) ) ?>
 * The result is that the tag groups display as taps, but no tags are displayed 
   underneath.
 * Please advise what I am doing wrong since none of the tags are displaying.
    Thank
   you in advance.

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13567069)
 * 1. What do you see if you use [tag_groups_cloud include=1,2,5,6] in a post and
   then click preview?
 * 2. Please post a link to the page where I can see the result.
 * 3. Are you sure that you have tag groups with the IDs 1,2,5 and 6 and that these
   groups contain tags, which were used with published posts?
 * 4. Please also check the settings and make sure that “Collapsible tabs” is off(
   under “Front End” -> “Themes and Appearance”)
    -  This reply was modified 5 years, 7 months ago by [Christoph](https://wordpress.org/support/users/camthor/).
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13567198)
 * Hi Chris,
 * Thanks for responding so quickly.
 * 1. With a shortcode I see the same. You can see it here:
 * 2. [https://autentical.com/test/](https://autentical.com/test/)
 * 3. I have 3 tag groups – I also tried including 1,2,3 – and the tag groups come
   up correctly. But still without any tags below…
 * BUT: I now found out that it is a language issue… (I use WPML). When publishing
   on the German site the tags come up.
 * So the challenge is now: How do I ONLY display German tag groups on the German
   site and English tag groups on the English site – when the sidebar.php is commom
   for all languages?
 * Thanks again for your help.
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13567262)
 * It should be possible to choose different group names for each language (in the
   admin you can set the language in the top bar). Then you assign the translated
   tags to the translated tag groups. It is possible, that the translated tags were
   not used in published posts (only the untranslated tags). You can add the parameter`
   hide_empty=0` to show all tags, or with PHP
    `if ( function_exists( 'tag_groups_cloud'))
   echo tag_groups_cloud( array( 'include' => '1,2,5,6', 'hide_empty' => 0 ) );`
 * PS: You could also try with `remove_filters=0` if that didn’t help.
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13567500)
 * Hi Chris,
 * 1) “…translated tag group…” you say. But I cannot see anywhere tag groups can
   be translated… And if I create extra tag groups they will all appear on all languages.
   Please explain how to translate tag groups.
 * 2) My real desire is to show only the relevant tags for each destination (‘category’).
   I managed to set it up on …/category/… pages (as you may see on e.g. [https://autentical.com/category/portugal/](https://autentical.com/category/portugal/)),
   but not on …/tag/… pages. I have noticed that you have undocumented functionality
   for the categories in the plugin… Is there any way to use this plugin to show
   only tags relevant to the category – even when clicking the tag and ending up
   on the …/tag/… page?
 * Thank you in advance for your help.
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13567880)
 * 1) You click into the name of a tag group and then write the name in the selected
   language. see [https://documentation.chattymango.com/documentation/tag-groups-premium/getting-started/translating-tag-group-names-with-wpml-2/](https://documentation.chattymango.com/documentation/tag-groups-premium/getting-started/translating-tag-group-names-with-wpml-2/)
 * 2) It’s not possible out of the box, but you could embed some custom code into
   your theme so that the “include” parameter that you already used is different,
   depending on the category. It’s more or less this code: [https://documentation.chattymango.com/documentation/tag-groups/for-developers-tag-groups/examples-of-applications/#2–display-a-different-tag-cloud-on-each-category-page-](https://documentation.chattymango.com/documentation/tag-groups/for-developers-tag-groups/examples-of-applications/#2–display-a-different-tag-cloud-on-each-category-page-)
 * 3) (anticipating your next question 😀 ) I am now investigating a possible bug
   that shows tags of the wrong language. If that happens, please wait for the next
   update.
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13568443)
 * 1) I got the tag groups translated. Thanks.
 * 2) I have tested your application example no. 2 and it also only works on …/category/…
   pages – not on …/tag/… pages.
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13568577)
 * Which code did you use on the tags pages? [get_cat_ID](https://developer.wordpress.org/reference/functions/get_cat_id/)
   surely won’t work here, that’s only for categories.
 * Maybe this could work (in the tag archive template):
 *     ```
       $tag = get_queried_object();
   
       $term_group = array(
       		'term-1' => 3,
       		'term-2' => 2,
       	); // ... left side tag slugs, right side group IDs
   
       if ( function_exists( 'tag_groups_cloud' ) && isset( $term_group[ $tag->slug ] ) ) {
         echo tag_groups_cloud( array('include' => $term_group[ $tag->slug ] ) );
       }
       ```
   
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13568651)
 * Thanks a lot. I will try this.
 * But if it works I will want to display the tags in my theme’s style (the theme
   link style). Isn’t that possible with the plugin?
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13569095)
 * Yes, it works. Thank you.
 * Now just the question about how I can use the link design of the theme?
 * I tried already ” Don’t load a theme.” and “Allow HTML in tag description”, but
   this does not bring back the theme link design….
 * Please let me know how I can get the default theme link design for the tags. 
   Thank you in advance.
 * PS! I don’t need the Tag Group name – just the tags of the tag group.
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13570772)
 * For design customization questions you need to consult your web designer. The
   plugin provides only a basic design.
 *  Thread Starter [elarpa](https://wordpress.org/support/users/elarpa/)
 * (@elarpa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13570823)
 * OK, fair enough.
 * Just one question: Why does ”Don’t load a theme.” not cancel the design build
   into the plugin so that the standard link design of the theme would work?
 *  [Christoph](https://wordpress.org/support/users/camthor/)
 * (@camthor)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13570978)
 * These things work differently. Your theme uses CSS to define the properties of
   all items that the theme creator decided to integrate. The theme cannot automatically
   design all items that are additionally added later. In general, nothing in web
   design works automatically, there is a lot of invisible work behind the scenes.
   So someone must apply your theme’s design to everything else that the theme creator
   was not aware about. This should be quite fast, if you know what to look for.
 * The ”Don’t load a theme.” option disables _jQuery UI themes_, which you can see
   here: [https://jqueryui.com/themeroller/](https://jqueryui.com/themeroller/) 
   As you can see there that theme doesn’t affect the tags so that designers are
   free to use their own design.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘PHP example from Front End page does not work’ is closed to new replies.

 * ![](https://ps.w.org/tag-groups/assets/icon-256x256.png?rev=2853023)
 * [Tag Groups is the Advanced Way to Display Your Taxonomy Terms](https://wordpress.org/plugins/tag-groups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tag-groups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tag-groups/)
 * [Active Topics](https://wordpress.org/support/plugin/tag-groups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tag-groups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tag-groups/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [Christoph](https://wordpress.org/support/users/camthor/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/php-example-from-front-end-page-does-not-work/#post-13570978)
 * Status: resolved