WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_list_cats in header (3 posts)

  1. nasirmajor
    Member
    Posted 6 years ago #

    i want to show categories list in header as well. before that they are being shown in left panel of wordpress theame im using.
    can this function be called twice in same file?
    errors are asking to include following files that im adding as well.
    ============
    <?php include_once("wp-config.php"); ?>
    <?php include("wp-includes/wp-db.php"); ?>
    <?php include("wp-includes/category-template.php"); ?>
    <?php include("wp-includes/plugin.php"); ?>
    <?php include("wp-includes/formatting.php"); ?>
    <?php include("wp-app.php"); ?>
    <?php include("wp-includes/functions.php"); ?>
    <?php include("wp-includes/deprecated.php"); ?>
    ========
    even after that an error comes unable to set connection with database.

    ------------------

    being my first wordpress project im totally new to it. anyone help for right direction how to solve this out?

  2. moshu
    Member
    Posted 6 years ago #

    You must be doing something wrong...
    Yes, you can use the

    <ul>
    <?php wp_list_categories(); ?>
    </ul>

    code both in the header.php and in the sidebar.php. Just tested; it should NOT require any complicated stuff as you posted above.

  3. nasirmajor
    Member
    Posted 6 years ago #

    Thanks dear Moshu
    the problem is solved
    it was the problem of theme header code before <html> tag. i replaced it with the default theme headers code and problem was resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic