Support » Plugins » Category Icon Plugin

Viewing 15 replies - 1 through 15 (of 24 total)
  • Anonymous

    OK, I feel dumb. I’m a newbie to WordPress, so maybe it’s normal…
    I have a WordPress 1.2 setup.
    I installed the CategoryIcon Plugin in the right directory, after the needed changes.
    It appeared in the plugins list. I activated it.
    It is the only plugin activated.
    I have only 2 icons ready for the 6 categories. They are following the syntax of the original category name, plus the extension, all in the correct dedicated directory.
    Nothing show on the blog.
    Do I need to add a tag in the template?
    Thanks Nico

    Anonymous

    The plug-in is working for me except that when it is enabled I am unable to login when I try I get the following errors
    Warning: Cannot modify header information – headers already sent by (output started at /home/polargee/public_html/wp-content/plugins/cat-icon.php:69) in /home/polargee/public_html/wp-login.php on line 257
    Warning: Cannot modify header information – headers already sent by (output started at /home/polargee/public_html/wp-content/plugins/cat-icon.php:69) in /home/polargee/public_html/wp-login.php on line 258
    Warning: Cannot modify header information – headers already sent by (output started at /home/polargee/public_html/wp-content/plugins/cat-icon.php:69) in /home/polargee/public_html/wp-login.php on line 259
    Warning: Cannot modify header information – headers already sent by (output started at /home/polargee/public_html/wp-content/plugins/cat-icon.php:69) in /home/polargee/public_html/wp-login.php on line 260
    Warning: Cannot modify header information – headers already sent by (output started at /home/polargee/public_html/wp-content/plugins/cat-icon.php:69) in /home/polargee/public_html/wp-login.php on line 261
    any ideas

    cube

    (@cube)

    I’ve the same Problem like “camelreef”! I have also the Plugin from ‘Chris Cosentino’ and nothing is shown on my page! I think it’s because of the absolut path /*ร‚ย ร‚ย absolute system path to your icon directory, include trailing slash */
    $icon_path = "/v4/weblog/wp-category-icons/";

    I have also tried the absolut path $icon_path = "/home/2btixw2/htdocs/v4/weblog/wp-category-icons/"; wich I have copyed from my old MT-Weblog Admin screen.
    How can i check what’s the Problem with this plugin?

    Anonymous

    The $icon_path should have the absolute system path of your icon directory .. just go to your icon directory and issue ‘pwd’ command and it will show you the absolute path. The $icon_url should points to path from your home directory .. and in your case ..
    $icon_path = “/home/2btixw2/htdocs/v4/weblog/wp-category-icons/”
    $icon_url = “/htdocs/v4/weblog/wp-category-icons/”
    Good luck!

    ShelbyYY

    (@shelbyyy)

    Anonymous: Hi. ๐Ÿ™‚
    When you get errors like “Warning: Cannot modify header information…” it’s because you have something in the code which sends out for information at the very outset – i.e., before your server continues parsing the rest of the page, but you’re trying to add another thing that needs to send information at the very outset. It’s possible to send it all at once, and get everything you need taken care of. ๐Ÿ™‚
    In my case, for example, there are several things which send out for info at the outset. The problem is, you can’t have one request end, and another try to begin. It will only send out one time at the very outset, and then it continues with the rest of the page. So, if you have multiple things that need to get information from the very beginning, you need to sort of put them all in one call! ๐Ÿ™‚
    The very beginning of my index.php template, for example looks like this:
    ‘<?php
    require_once(‘wp-blog-header.php’);
    include(‘cookiecheck.php’);
    wp_head();
    ?>’
    What that means, in plain terms, is that I have the wp-blog-header.php being sent from the very outset, also, cookiecheck.php – which is for skinning the site, and then the wp_head function call. LOL. So, if a plugin told me that I had to add ‘<?php function_call(); ?>’ at the very beginning of the document, instead of doing that, I would have to simply take the ‘function_call();’ part of it, and put that inside what I already have. For example:
    ‘<?php
    require_once(‘wp-blog-header.php’);
    include(‘cookiecheck.php’);
    wp_head();
    function_call();
    ?>’
    Hopefully that makes sense. ๐Ÿ™‚ Maybe someone else would be better at explaining that than I am.

    MattRead

    (@mattread)

    I’m getting this warning evertime I try to login to my WP. I have to disable this plugin then I can login again. I also get similar warnings when I try to edit a post, write a post, change options, and when someone posts comments. I think the Plugin has a BUG. As I say I only get the warnings when this plugin is enabled. I have tried disabling all others too.
    Warning: Cannot modify header information – headers already sent by (output started at /home/mayhemma/public_html/blog/wp-content/plugins/cat-icon.php:1) in /home/mayhemma/public_html/blog/wp-login.php on line 257
    Warning: Cannot modify header information – headers already sent by (output started at /home/mayhemma/public_html/blog/wp-content/plugins/cat-icon.php:1) in /home/mayhemma/public_html/blog/wp-login.php on line 258
    Warning: Cannot modify header information – headers already sent by (output started at /home/mayhemma/public_html/blog/wp-content/plugins/cat-icon.php:1) in /home/mayhemma/public_html/blog/wp-login.php on line 259
    Warning: Cannot modify header information – headers already sent by (output started at /home/mayhemma/public_html/blog/wp-content/plugins/cat-icon.php:1) in /home/mayhemma/public_html/blog/wp-login.php on line 260
    Warning: Cannot modify header information – headers already sent by (output started at /home/mayhemma/public_html/blog/wp-content/plugins/cat-icon.php:1) in /home/mayhemma/public_html/blog/wp-login.php on line 261

    carthik

    (@carthik)

    Mattread, someone has posted the same problem, and received a reply above. Does the suggested solution above work?

    carthik

    (@carthik)

    Hello. I from Russia and, logically, in names of categories use cyrillics. Taking into account, that in WordPress is used unicode in a database at creation of pictures for categories with names cyrillics the plug-in “does not see” them. I have solved this problem rather simply:
    ‘function icon_picker($text)
    {
    global $icon_path, $icon_url, $icon_align, $icon_ext, $icon_cat;
    $content = ”;
    $cat_names = array();
    $cat_ids = array();
    $cats = get_the_category(”);
    foreach ($cats as $category)
    {
    $cat_names[] = stripslashes($category->cat_name);
    $cat_ids[] = $category->category_id;
    }
    if($icon_cat == “first”)
    {
    $cat_to_use = $cat_names[0];
    $cat_id = $cat_ids[0];
    } else {
    $size = sizeof($cat_names);
    $cat_to_use = $cat_names[$size – 1];
    $cat_id = $cat_ids[$size – 1];
    }
    if(file_exists($icon_path . $cat_id . $icon_ext))
    {
    $filename = $icon_url . $cat_id . $icon_ext;
    $content .= “<img class=’caticon’ src='” . $icon_dir . $filename . “‘”;
    $content .= ” align='” . $icon_align;
    $content .= “‘ alt='” . $cat_to_use . ” Icon’ />\n”;
    $text = $content . $text;
    }
    return $text;
    }’
    That is I use not the name of a category, and it ID. It is not so convenient, as it is necessary to look through a database for search id for a category. Can be there is other, more convenient decision?

    I am having problems because one of my cats is named “blah/blah” and I can’t name an image blah/blah.jpg. Is there any way to make it so that image name is the cat id instead?

    Moderator Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    Have you tried the Category Image(s) plugin? If your category was named “blah/blah”, the associated image name would be “blahblah.jpg” (or .gif, or .png).

    If you want to have a default icon that shows for all categories that don’t have a specific icon, put this else in:

    else {
    $filename = $icon_url . “General” . $icon_ext;
    $content .= “<img class=’caticon’ src='” . $icon_dir . $filename . “‘”;
    $content .= ” align='” . $icon_align;
    $content .= “‘ alt='” . $cat_to_use . ” Icon’ />\n”;
    $text = $content . $text;
    }

    between $text = $content . $text;
    }

    and
    return $text;
    in the original code.
    Replace the word General with the category icon you want to use.

    so the final if looks like this:

    if(file_exists($icon_path . $cat_to_use . $icon_ext))
    {
    $filename = $icon_url . $cat_to_use . $icon_ext;
    $content .= “<img class=’caticon’ src='” . $icon_dir . $filename . “‘”;
    $content .= ” align='” . $icon_align;
    $content .= “‘ alt='” . $cat_to_use . ” Icon’ />\n”;
    $text = $content . $text;
    } else {
    $filename = $icon_url . “General” . $icon_ext;
    $content .= “<img class=’caticon’ src='” . $icon_dir . $filename . “‘”;
    $content .= ” align='” . $icon_align;
    $content .= “‘ alt='” . $cat_to_use . ” Icon’ />\n”;
    $text = $content . $text;
    }
    return $text;

    Ok, I’ve got the plugin up and running and it works fine. However, the icon is at the bottom of the post by the comment link. There, it almost looks like it belongs to the following post and is a bit confusing. I would prefer it at the top of the post near the category listings for the post. Is there somewhere I can change this?

    I also made a slight change in two lines above. They are the same line twice:

    $content .= "' alt='" . $cat_to_use . " Icon' />n";

    I like a tooltip when I hover over the icon:

    $content .= "' alt='" . $cat_to_use . " Icon' title='Filed Under " . $cat_to_use ."' />n";

    Got it! At the very bottom I changed

    add_filter ( ‘the_content’, ‘icon_picker’ );

    to

    add_filter ( ‘the_category’, ‘icon_picker’ );

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Category Icon Plugin’ is closed to new replies.