WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Get sidebar on other php pages (7 posts)

  1. sican
    Member
    Posted 4 years ago #

    Hi there,
    I am really new to php and I'm having some problems.

    The problem is that I want to add the sidebar from my blog section to another php file, which is in an upper directory of my website.

    How can I call the sidebar.php effectively to display the same sidebar?

    I tried <?php get_sidebar(); ?> and <?php get_PATH TO sidebar.php but it doesn't work apparently!

    Any help would be appreciated! Thanks! :)

  2. MichaelH
    Member
    Posted 4 years ago #

  3. sican
    Member
    Posted 4 years ago #

    hi, thanks for the reply!

    I tried adding the `<?php
    require('/the/path/to/your/wp-blog-header.php');
    ?>` but it gives me an error:

    Fatal error: Call to undefined function is_single() in PATH...

    Any ideas?

  4. MichaelH
    Member
    Posted 4 years ago #

    Replace /the/path/to/your/ with the correct path of your wp-blog-header.php script.

  5. sican
    Member
    Posted 4 years ago #

    Yeah Michael, I did replace the path with my header's path! LOL!
    I'm not that stupid :p

  6. sican
    Member
    Posted 4 years ago #

    Hey Michael, just to let you know, I managed to sort this thing!
    After clearing my head and coming back to it, I saw it!

    The path that I was pointing to was wrong :p

    Guess I am that stupid! LOL!

    Thanks for your help man!

  7. MichaelH
    Member
    Posted 4 years ago #

    Thanks for the feedback. Good Luck.

Topic Closed

This topic has been closed to new replies.

About this Topic