WordPress.org

Ready to get started?Download WordPress

Forums

2 category widgets - can posts be added to one or the other? (25 posts)

  1. modom
    Member
    Posted 6 years ago #

    Hi,

    Am new to wordpress...added the 2 category 1 and category 2 widgets to the sidebar and configured each to different names.

    How do I add a post to just one or the other?

    When I write a new post or manage one by editing the names of the 2 category widgets do not show up to list the post under. Is this possible to do?

    I was wanting this:
    category name and have a listing of articles under here
    category name 2 and have a listing of questions under here

    What is the best way to do this?

  2. bestfoot
    Member
    Posted 6 years ago #

    not sure I totally understand your question ...
    are you assigning posts to categories when you write them?

    That is done on the right hand side, second bar down I think.

  3. modom
    Member
    Posted 6 years ago #

    Hi,

    I added the widgets category 1 and category 2 under presentation/widgets to the sidebar and edited each for different names.

    When I add a "post" it adds the same post to both of the category 1 and category 2 categories that have different names.

    I have tried and tried but there is not a way to remove a post from either of the categories without removing it from both.

    Can this be done?

    This is the problem site:
    http://www.usprayercenter.org/ministry/resources/wordpress/archives/category/questions-answers

    The same listings are in both the category widgets.

  4. modom
    Member
    Posted 6 years ago #

    Anyone know if you can have 2 category widgets with different posts in each one?

  5. sacredpath
    Member
    Posted 6 years ago #

    I'm wondering about this also. I can't seem to get different categories into different category widgets. If I put two category widgets into my sidebar, both of them have the same categories listed.

  6. Hhuntington2
    Member
    Posted 6 years ago #

    I'm having a similar problem. I'm trying to add a text box to allow me to use the 'exclude' parameter, but I can only seem to get it to populate the database for my Category 2 widget (I've got Category 1, 2, and 3). I've been poking around in the wp_widgets_category_control function but can't seem to make it work. Any help would be appreciated.

    Thanks

  7. Hhuntington2
    Member
    Posted 6 years ago #

    hmmm, bump!

  8. ccryan
    Member
    Posted 6 years ago #

    Same issue here. Any resolution so far?

  9. MichaelH
    Member
    Posted 6 years ago #

    Just so there is no confusion--using the widget called Categories 1 does not mean that widget will display only the Category that is ID 1. Also, the Category Widget in not designed to display posts--it displays a link to that Category, which in turn will display the posts in that Category.

    If you want to show only a specific Category or set of Categories via a Widget then please consider downloading and installing Otto's execphp widget. Then in the widget you will need to use the proper code to display your selected categories using the template tag, wp_list_categories().

  10. Roar
    Member
    Posted 6 years ago #

    If anyone else does this and has the exact code we need, I will be your friend forever if you post the code here. php still makes me feel kinda dumb.

  11. MichaelH
    Member
    Posted 6 years ago #

    This code in Otto's execPHP widget will display Category 5 with the count of posts for that category.

    <?php
    wp_list_categories('show_count=1&include=5&title_li='); ?>
  12. zgirl
    Member
    Posted 6 years ago #

    I tried this method. So far - so good, except: I can't get rid of the word "categories" within my list.

    I used this code in the PHP widget window:

    <?php
    wp_list_categories('show_count=0&include=1,4title_ul='); ?>

    I titled it "RV Destinations" and it's in the upper left hand column: http://www.rvtraveler.com

    Any ideas how the heck to get rid of the word "categories"?

  13. Roy
    Member
    Posted 6 years ago #

    I have been trying to do something similar in a completely different way, being sub-categories. It is easy to make subcategories, so in this case there would be a category "articles" and a category "questions" and all the rest are sub-categories. My problem is -though- that the widget that I use just puts everything under eachother, whether category or subcategory. If this problem is solved, I think Modom's problem is solved as well, easily.

  14. yakuphan
    Member
    Posted 6 years ago #

    @zgirl,
    your code must be like this,
    wp_list_categories('show_count=0&include=1,4title_li='); ?
    you must change "title_ul" to "title_li"

  15. zgirl
    Member
    Posted 6 years ago #

    Hmmm... I changed it to "ul" because I wanted it to be formatted as a "ul".... guess I'll have to think about this...

    Thanks!
    -Z

  16. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    zgirl: That's not how those options work. They are just named parameters. The name of the parameter is arbitrary, they don't control anything by changing the name.

  17. speerga
    Member
    Posted 6 years ago #

    I'm a simple person with little background for hacking any of the WP code or PHP in general, so I often come here and get real help. For that I thank you all.

    I have a simple question related to this thread on category widgets and try as I might, I cannot find answers here or via Google or Yahoo! or anywhere else.

    What in the world is the purpose of the multiple category widgets available via most WP themes these days? I was hoping to do something similar to what's asked about in this thread. It seems if I create category-1 and category-2 widgets, I ought to be able to easily display categories I want in number 1 and others I want in number 2.

    But, as pointed out here, I can't easily do that.

    So what in the world is the purpose of being able to create multiple category widgets? And is there a plugin that will allow multiple category widgets displaying different categories in each widget?

    I really appreciate the tremendous help this forum offers. Thanks in advance.

  18. MichaelH
    Member
    Posted 6 years ago #

    @speerga: Yeah good point about the Category widgets--hopefully they'll get some attention in future releases.

    Otto's execPHP is a pretty easy way to get a different widget for each set of categories you want, but since that doesn't seem to be acceptable, check out http://widgets.wordpress.com/?s=category

  19. speerga
    Member
    Posted 6 years ago #

    @MichaelH -- you said: "Otto's execPHP is a pretty easy way to get a different widget for each set of categories you want, but since that doesn't seem to be acceptable,.. "

    I have a plugin installed called Exec-PHP. Is that the same as Otto's widget you're referring to?

    It sounds like, from your comment, that the execPHP widget you've mentioned would do what I want if it let's me get "a different widget for each set of categories." Or at least it would get me close to what I want?

    Any way you can explain to me what I would need and how that might work to do it that way?

    Thanks again to all of you for your help and suggestions.

    Gary

  20. paintsilence
    Member
    Posted 6 years ago #

    I had the same needs and was so glad to finally find the answer here: Otto's widget!
    But even after I installed the plug in, I do not see any php text widget box added to the old widget selections. The plug seems to be installed right because i see it listed in my plugin management page. What can be wrong with this?

  21. listenupza
    Member
    Posted 5 years ago #

    this thread has been a massive help in getting me where I want to be!

    thanks!

  22. rize
    Member
    Posted 5 years ago #

    Anybody know how to remove the word 'category'?

    Code im using is

    <ul><?php wp_list_categories('orderby=name
    &use_desc_for_title=0&child_of=212'); ?></ul>
  23. kristarella
    Member
    Posted 5 years ago #

    @rize
    You can find all the wp_list_category parameters at
    http://codex.wordpress.org/Template_Tags/wp_list_categories

    To remove the title you can add &title_li= after 212 in your code.

    @everyone else
    Some good code for selectively showing posts in categories is at
    http://www.pearsonified.com/2008/02/what_every_blogger_needs_to_know_about_categories.php

  24. JayMyers
    Member
    Posted 5 years ago #

    So it would appear..and this is driving me nuts too...We still don't know why we can put multiple instances of the built in category widget on sidebars? In other words BUMP.

    And yes that Chris Pearson article is great, but still think the widget could be better. Starting to hate categories and tags.

  25. lilqhgal
    Member
    Posted 5 years ago #

    If there was a simple setting to the categories widget that said "show the following categories only" and then let you put in the category ID# (or #s separated by comma), I would think this would be the perfect fix to the problem...

Topic Closed

This topic has been closed to new replies.

About this Topic