• 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=”https://<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://www.ads-software.com/plugins/wp-knowledgebase/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rborn

    (@rborn)

    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

    (@rborn)

    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.