Hi,
Currently there is no way to add a custom link above the “back to site” link. However this could be something we’ll add in the future, so I’ve added it as as feature request: https://roadmap.couponaffiliates.com/boards/feature-requests/posts/custom-links-on-affiliate-portal-sidebar/
There is however the “wcusage_portal_hook_sidebar_bottom” hook (right below “back to site”) available already, which would allow you to add custom code below the sidebar links programmatically, via some custom function.
For example:
function my_custom_portal_sidebar_link() {
echo '<a href="#">My Custom Link</a>';
}
add_action( 'wcusage_portal_hook_sidebar_bottom', 'my_custom_portal_sidebar_link' );
Should i now copy the code and paste on the theme’s function.php file? Thanks.
I’d recommend asking a developer to help you out if you don’t have experience work with custom code as it could break your website.
You would need to edit the link and text, then add it to your themes functions.php file or use a code snippet plugin.
Be sure to take a website backup beforehand, and do your own testing to make sure it works and looks OK.
Not work, here is what i did below:
function my_custom_portal_sidebar_link() {
echo '<a href="https://www.bloghoursstudio.com/my-account/">My Custom Link</a>';
}
add_action( 'wcusage_portal_hook_sidebar_bottom', 'my_custom_portal_sidebar_link' );
Hi,
I just tested this on my end and it worked fine. There may be something wrong with where you have put the code.
Maybe try a code snippets plugin instead: https://wordpress.org/plugins/code-snippets/
It’s what i used now, but did’nt work for me, i dont know what was wrong.
It just worked bro. Thanks.
But the text color did’nt mach my website brand, how can i change the color to white please? Thanks for the support.
You can set a custom color with CSS like this:
echo '<a href="#" style="color: #fff;">My Custom Link</a>';