Title: Sub-article icons
Last modified: August 31, 2016

---

# Sub-article icons

 *  [rborn](https://wordpress.org/support/users/rborn/)
 * (@rborn)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sub-article-icons/)
 * Don’t know much about this but I am getting an error with the “+” and “-” icons
   for sub-articles. The link to the minus icon has the directory listing for the
   plus icon with the directory for the minus icon at the end. You can see why this
   happens in the code at the bottom from “wp-knowledgebase.php”. Here is the output:
 * <img src=”[http://<site](http://<site) URL>/wp-content/plugins/wp-knowledgebase/
   template/images/kbe_icon-plus.png/template/images/kbe_icon-minus.png”>
 * So the original “+” icon works when the page is displayed, but when you click
   on it, you get the error above and the “+” icon remains. Click on it again and
   it tries to tack on the plus icon directory info, still will show the “+” icon.
 * I think I can fix this but wondering if this is in the original code or got in
   there with a setting I used.
 *     ```
       jQuery('div.kbe_category > span.switch').click(function () {
                   var tree_id = jQuery(this).parent().attr('id');
                   if (jQuery(this).hasClass('open')) {
                       jQuery(this).parent().find('div:first').slideUp('fast');
                       jQuery(this).removeClass('open');
                       jQuery(this).html('<img src="<?php echo plugins_url('template/images/kbe_icon-plus.png',__FILE__) ?>
       kbe_icon-plus.png" />');
                   } else {
                       jQuery(this).parent().find('div:first').slideDown('fast');
                       jQuery(this).html('<img src="<?php echo plugins_url('template/images/kbe_icon-plus.png',__FILE__) ?>/template/images/kbe_icon-minus.png" />');
                       jQuery(this).addClass('open');
                   }
       ```
   
 * [https://wordpress.org/plugins/wp-knowledgebase/](https://wordpress.org/plugins/wp-knowledgebase/)

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

 *  Thread Starter [rborn](https://wordpress.org/support/users/rborn/)
 * (@rborn)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sub-article-icons/#post-7014537)
 * I obviously don’t know how this works, but I changed it to the following and 
   the errors go away and I get the correct paths, but the “-” icon does not show,
   the “+” is always displayed.
 *     ```
       jQuery('div.kbe_category > span.switch').click(function () {
                   var tree_id = jQuery(this).parent().attr('id');
                   if (jQuery(this).hasClass('open')) {
                       jQuery(this).parent().find('div:first').slideUp('fast');
                       jQuery(this).removeClass('open');
                       jQuery(this).html('<img src="<?php echo plugins_url('template/images/',__FILE__) ?>kbe_icon-plus.png" />');
                   } else {
                       jQuery(this).parent().find('div:first').slideDown('fast');
                       jQuery(this).html('<img src="<?php echo plugins_url('template/images/',__FILE__) ?>kbe_icon-minus.png" />');
                       jQuery(this).addClass('open');
                   }
       ```
   
 *  Thread Starter [rborn](https://wordpress.org/support/users/rborn/)
 * (@rborn)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sub-article-icons/#post-7014578)
 * Found out why the “+” sign was always showing. In kbe_style.css is the following:
 *     ```
       .kbe_category span.switch img {
           margin: 0px;
           content: url("images/kbe_icon-plus.png");
       }
       ```
   
 * This “content” always adds the plus sign. As far as I can tell, the PHP file 
   will determine this, if “+” or “-“. Removing the “content” property and making
   the above corrections to the PHP file, seems to work well.

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

The topic ‘Sub-article icons’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-knowledgebase_c56559.svg)
 * [WordPress Knowledge base & Documentation Plugin - WP Knowledgebase](https://wordpress.org/plugins/wp-knowledgebase/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-knowledgebase/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-knowledgebase/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-knowledgebase/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-knowledgebase/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-knowledgebase/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [rborn](https://wordpress.org/support/users/rborn/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/sub-article-icons/#post-7014578)
 * Status: not resolved