<a href=”<?php echo esc_url($blog_url); ?>” class=”btn-ghost-kernel”>Browse all articles</a> How can I modify the $vblog_url??
If you mean “how do I change the value of $blog_url?”, you need to assign a different URL to the variable before the <a> tag.
For example:
<?php$blog_url='https://example.com/blog/';?><ahref="<?phpechoesc_url( $blog_url ); ?>"class="btn-ghost-kernel"> Browse all articles</a>
WordPress recommends using esc_url() when outputting a URL in an href, as you’re already doing.
If you actually meant $vblog_url
If your code currently has:
<ahref="<?phpechoesc_url($blog_url); ?>"class="btn-ghost-kernel"> Browse all articles</a>
but you want to use $vblog_url, simply change it to:
<ahref="<?phpechoesc_url($vblog_url); ?>"class="btn-ghost-kernel"> Browse all articles</a>
Then define $vblog_url beforehand:
<?php$vblog_url='https://example.com/articles/';?>
If you want to modify the existing URL
For example, if $blog_url is already:
https://example.com/blog/
and you want to add a query parameter such as ?category=news, WordPress has add_query_arg() for this:
<?php$vblog_url=add_query_arg('category','news',$blog_url);?><ahref="<?phpechoesc_url( $vblog_url ); ?>"class="btn-ghost-kernel"> Browse all articles</a>
add_query_arg() builds the modified URL, while esc_url() should still be used when outputting it.
If you show me where $blog_url is currently defined, I can tell you exactly what line to change.
Where can i change it in the admin?
If $blog_url is coming from a WordPress theme/plugin, you usually can’t change it directly from the normal WordPress admin unless the developer made it an editable setting.
Check these places:
- WordPress Admin → Settings
- Look for something like Blog, Reading, or Theme Settings.
- Go to Settings → Reading and check the Posts page setting. This is commonly where the blog/archive URL comes from.
- Appearance → Customize
- Look under Theme Options, Homepage Settings, Menus, etc.
- The link may be configured there.
- Pages → All Pages
- Find the page you want the “Browse all articles” button to point to.
- If it’s the WordPress posts archive, check Settings → Reading → Posts page.
- If none of those contain it
$blog_urlis probably being generated in PHP, e.g.: $blog_url = get_permalink(…); or $blog_url = get_post_type_archive_link(…);- In that case, you need to change the PHP/theme configuration rather than an admin setting.
If you paste the 10–20 lines above this code:
<ahref="<?phpechoesc_url($blog_url); ?>"class="btn-ghost-kernel">
I can identify exactly where $blog_url is coming from and whether you can change it in WordPress Admin.
Hello