WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category Navigation (8 posts)

  1. weinerschizel
    Member
    Posted 4 years ago #

    I would like to have a navigation bar on the left hand side that include the different topic categories I have. Unfortunately, I'm not seeing it in the dashboard / settings and I cannot find a post on it.

    Perhaps it's just too simple a question ;) I'm afraid I'm quite a newbie to this. Thanks for your help!

  2. henkholland
    Member
    Posted 4 years ago #

    Hi,

    You need to add this to your sidebar:
    <?php wp_list_categories('title_li='); ?>

    http://codex.wordpress.org/Template_Tags/wp_list_categories

  3. weinerschizel
    Member
    Posted 4 years ago #

    Thanks! I read the article but not sure which source file is the side bar. How do I determine where "exactly" to place the code?

    Thanks!

  4. henkholland
    Member
    Posted 4 years ago #

    Hi , this depends on the theme you have. Could be sidebar.php or left-sidebar.php
    Note:
    1. Always backup such a file before editing (in case something goes wrong)
    2. If you are using the default theme, do not edit it directly but first copy the complete theme folder content to a new folder and call that one mytheme (or something else you like). Otherwise your editing will be lost after a WordPress update because WordPress updates the default and the Classic theme.

  5. weinerschizel
    Member
    Posted 4 years ago #

    Thanks! I found it and was able to start modifying the content on my sidebar. I'm curious though, how do I comment something out in PHP. I've programmed in about a zillion languages just not PHP and the comments don't seem to be working for me.

    1. I looked at other comments (c style /* comment */) and tried that. No dice.
    2. Google and discovered there were several others that might work... (//, #, <-- comment -->) but couldn't get any of these to work either.

    So how exactly do you comment out tags / lines of code in PHP.

  6. henkholland
    Member
    Posted 4 years ago #

    Hi,

    In between <?php and ?> use this:

    <!-- This is an HTML or PHP Comment -->

  7. alchymyth
    Forum Moderator
    Posted 4 years ago #

    these days, google is your friend; (search 'php comment')

    and so is the w3school.com:

    http://www.w3schools.com/PHP/php_syntax.asp

  8. henkholland
    Member
    Posted 4 years ago #

    Sorry, thank you alchymyth.
    Mine was FOR OUTSIDE <?php and ?> but still in a .php file like header.php

Topic Closed

This topic has been closed to new replies.

About this Topic