WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Category widget doesn't work

[Resolved] Category widget doesn't work

  • Like a crazy person, I bought a template without widgets.

    So I widgetized it, adding a category and an archive widget. Everything LOOKS good (http://blingwomen.org/stories/).

    But the widgets don’t work. Can anyone point me in the right direction?

    MANY thanks!

    Susan

Viewing 8 replies - 1 through 8 (of 8 total)
  • Michael

    @alchymyth

    Forum Moderator

    the widgets might be ok, but there could be somthing odd with archive.php of your theme.

    can you paste the code of archive.php (or index.php if archive.php does not exist) into a http://pastebin.com/ and post the link to it here?

    Thanks, alchymyth! I appreciate the help.

    Here’s the link:

    http://pastebin.com/bkxjW26V

    Best,

    Susan

    If anyone has a suggestion, I’d sure appreciate it.

    Thanks,

    Susan

    Michael

    @alchymyth

    Forum Moderator

    thanks for the code of the archive template;
    some of the code doesn’t make sense or is simply wrong;
    it certainly would not allow the flexibility to show various types of archives; and it would not get the right category to show.

    first, make a backup copy of your template, in case the suggested changes are going wrong.

    then try this instead:

    http://pastebin.com/TWcppqVq

    OMG! Alchymyth, it works like a champ! Thank you SO MUCH!

    I’m a PHP neophyte, so it will be great for me to compare these two documents. The author of my template had no intention of widgetizing, so maybe that’s one reason the code was just plain wrong. I don’t know.

    In the meantime, I’ve also visited your site for some very helpful information.

    Please let me know if there’s anything I can do for you! You’ve totally MADE MY DAY.

    Best,

    Susan

    Michael

    @alchymyth

    Forum Moderator

    The author of my template had no intention of widgetizing, so maybe that’s one reason the code was just plain wrong.

    no.

    a:
    an archive template ‘knows’ automatically what to show; so all the query_posts() code was unneccessary.
    b:
    by adding a category based query, the monthly archive was made impossible.
    c:
    in case one has to create a query of an category archive, the line would simply be:
    query_posts('cat=' . get_query_var('cat') );
    d:
    get_the_category() is a function to be used within the loop, to get the categories of a single post. it cannot properly work in a category archive to get the category information.

    ——
    on the positive side – the design and the animation is quite nice 😉

    HAHA. I’m glad there is a positive side. I’ve had quite a time getting this template to work. My client liked it so much, and I don’t know enough (yet) to make a template from scratch. So I kept banging my head against the wall.

    🙂

    One of my next tasks: to have the category and archive selection yield a list, not full posts. I thought one needed a search.php file to make this happen, but there isn’t such a file. Any suggestions or links to other sites? I’ve been all over the web the past two days, and will keep at it until I wrangle this.

    I am going to get the hang of WordPress under the hood one day!

    Susan

    Hey, Alchymyth, I did it! WELL, I have replaced “content” with “excerpt” before, but this one seemed not to work right away. Anyway, it’s not a perfect solution (it’s a little difficult to tell that this is a list, not several short blogs), but it’ll do for a while. Any suggestions welcome.

    http://www.blingwomen.org/stories/

    Thanks for all of your help.

    Your student,

    Susan

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Category widget doesn't work’ is closed to new replies.
Skip to toolbar