Can I get a “base URL” in WordPress within a template file?

前端 未结 5 661
有刺的猬
有刺的猬 2021-02-01 03:57

Usually in my PHP apps I have a base URL setup so I can do things like this

tom/jones\">Tom
         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 03:59

    get_bloginfo('wpurl'); would be the preferred method of getting the base url of your WordPress installation. This always returns the absolute base url for the install where as get_bloginfo('url'); is for the actual blog address of your WordPress install.

提交回复
热议问题