If my permalink structure is set to
/blog/%postname%/, how can I retrieve a URL for my site which retrieves
With the permalink structure mentioned above, when using
site_url();, it displays
domain.com/ when I'm looking to easily get the site's URL including the front base.
Maybe I'm unclear about what the "front base" actually is.
I'm under the impression that the front base is your "Permalink Structure". (Stored in the option
site_url(); ... Both output just
I'm thinking about just using
site_url(); then retrieving the option
permalink_structure, parsing the contents of the option myself, then appending it to the
$permalink_structure = get_option('permalink_structure'); $front_base = preg_replace('#(\%)(.*)(\%/)#si', '', $permalink_structure); echo site_url($front_base, 'http').PHP_EOL;
Is there an easier way to get the site's URL including the front base?