WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Is echo redundant for site_url()? (3 posts)

  1. Opally
    Member
    Posted 1 year ago #

    I see in the codex that standard usage states
    echo site_url();
    but the output is by default an echo. Is there a good reason to use echo when using site_url() to build paths and links?

    Hmm, I just ran a test of it in the header, and when I removed the "echo" the site_url() link became the local page link. Why is that?

  2. No site_url() returns a string. It does not echo.

  3. Opally
    Member
    Posted 1 year ago #

    Thanks! I think I was misled by some browser caching into thinking that I was getting an echo when I wasn't.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags