Forums

[resolved] When im adding categories they are not showing. (14 posts)

  1. aidanl
    Member
    Posted 3 years ago #

    Hi, I think the topic title informs you of my problems....

    If anyone can help me with this it would be grately appriciated.

    The blog is at - (it isnt finished yet hence the randomish post(s))

    www.aidanloughran.co.uk/wordpress/

    Thanks in advance

    Ade

  2. Chris_K
    Administrator
    Posted 3 years ago #

    By default, Categories won't show in the blog's category list until there are posts associated with them.

    If you wish to change that, have a glance at the wp_list_cats documentation: http://codex.wordpress.org/Template_Tags/wp_list_cats

  3. Nitallica
    Member
    Posted 3 years ago #

    Are the categories empty? Your template may be set to hide empty categories.

  4. Nitallica
    Member
    Posted 3 years ago #

    D'oh! I've been Out-Solo'd! ;)

  5. aidanl
    Member
    Posted 3 years ago #

    So, would I type something like -
    <?php wp_list_cats(all=1'); ?> ?

    Apologies if im coming across thick just I dont fully understand the PHP coding and where to put it...

    Thanks

    Aidan

  6. moshu
    Member
    Posted 3 years ago #

    No. Go back to that Codex page again and read more carefully ALL the parameters! It's not php it's plain English, like "hide_empty"...

  7. aidanl
    Member
    Posted 3 years ago #

    Ok, I see the one I would like to use which is all. Whereabouts am I putting this into the coding? I thought perhaps the sidebar.php file, but I am not sure whereabouts in the sidebar.php file.

  8. moshu
    Member
    Posted 3 years ago #

    Read again: to display the empty categories you don't need the "all" parameters. That's for something else :)

    Well, open your sidebar.php in a plain text ediotr and find the template tag - modify it.

  9. aidanl
    Member
    Posted 3 years ago #

    Right ok, if it isnt all im going to have to guess at one, perhaps 'file'.

    With reference to the sidebar.php file, I think it may go in the following area -

  10. <h2>Categories</h2>
    <ul class="categories">
    <?php wp_list_cats(); ?>
  11. If im wrong please correct me because im clearly not grasping this properly.

    Thanks

    Aidan

  • moshu
    Member
    Posted 3 years ago #

    Man, stop posting and READ. I gave you the clue above - mentioning the hide_empty parameter. Wasn't that clear enough???

  • Nitallica
    Member
    Posted 3 years ago #

    It's a little confusing if you're brand new to WP tags, but not too hard once you get the hang of it.

    Like moshu says, open your sidebar.php in a plain text editor, like Notepad or Wordpad. (not MS Word, or it will mess with your code!!!)

    Look for this bit of code:

    <?php wp_list_cats('

    That the beginning piece, it will be followed (maybe) by various parameters. If so, add the following just after the single quote above:

    hide_empty=0&

    But if it has no existing parameters listed -- meaning that there is nothing between the single quotes/parenthesis -- then you'll add everything I listed except the ampersand (&) mark, and would look like this:

    <?php wp_list_cats('hide_empty=0'); ?>

  • aidanl
    Member
    Posted 3 years ago #

    Im sorry I didnt understand you Moshu.....
    The reason I didnt catch on is because I just wanted all the categories displaying regardless, but I that one you have suggested will be sufficient.

    Thank you Nitallica for your in depth and very helpful response. I am actually ok with general web design i.e. CSS.
    I shall try the coding now, hopefully it will work. :)

    Thanks again

    Aidan

  • aidanl
    Member
    Posted 3 years ago #

    Nitallica it has work as I wanted. Your help is much appriciated.

    Thanks :)

    Aidan

  • Nitallica
    Member
    Posted 2 years ago #

    Glad to hear it worked. :)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags