The MU forums have moved to WordPress.org

Blog's slug for Template (2 posts)

  1. smuda
    Member
    Posted 14 years ago #

    hey, i'm looking for a way to the »url slug« for the current blog to use in my template.

    like: example.tld/NAME

    and i just want »NAME«. <?php bloginfo('name'); ?> won't work because it may contain umlauts etc, i just need the slug.

    thanks! :)

  2. tim.moore
    Member
    Posted 14 years ago #

    You should be able to do:

    get_option('siteurl');

    You'll then have to strip out the part you don't want.

    Alternatively, you could get the current blog ID and do a look up for the path column in the wp_blogs table. That'll give you /NAME/

About this Topic