Shortcode inside subfooter

Posted in: Newsmag
Post count: 15

Hello i’m trying to insert shortcode inside subfooter text.
It is working fine in visual composer. What i’m doing wrong?

https://www.dropbox.com/s/cjw3dsdvetap2z3/%D0%91%D0%B5%D0%B7%D1%8B%D0%BC%D1%8F%D0%BD%D0%BD%D1%8B%D0%B9.png?dl=0

I’m adding this shortcode via plugin using this code:

function rurls_convert_base_domain() {
$string = site_url();
$pattern = ‘(^https\:\/\/|^http\:\/\/)’;
$replacement = ”;
return preg_replace($pattern, $replacement, $string);
}
add_shortcode(‘base_domain’, ‘rurls_convert_base_domain’);

Post count: 6535

Hi

I am not really sure what you’re trying to do so please provie more specific details about desire result and where did you added that code and maybe I can help.

Thanks!

Post count: 15

I’m trying to add a universall text in the subfooter using shortcode.
Final result should be like this – ‘Copyright example.com 2003 – 2016’.

Post count: 6535

Hi

You don’t need to use shortcodes to achieve the desired result, just add the text in footer copyright text from theme panel and the rezult will be like here: http://screencast.com/t/sxpOUxGlFhrhttp://screencast.com/t/ZwO0tdOvBd

Thanks!

Post count: 15

I need this shortcode because this is a template which i’m going to clone to a lot of websites.

Post count: 6535

Hi

Try this code in functions.php: http://screencast.com/t/0RqeGb7ql

function rurls_convert_base_domain() {
$string = site_url();
$pattern = "(^https\:\/\/|^http\:\/\/)";
$replacement = '';
return preg_replace($pattern, $replacement, $string);
}
add_shortcode('base_domain', 'rurls_convert_base_domain');

You also have to edit footer.php file and add this line here: http://screencast.com/t/j7owEuw6Xq84

Hope this helps.
Thanks!

Post count: 15

this function is stored in plugin, i have checked it is working without need to be added to functions.php.

is it possible to do this without editing footer.php?
later i might have problems with future updates

Post count: 6535

Hi

No you can’t use it as a similar plugin because the sub-footer part is entirely generated by the theme and you have to modify its files to make some customizations there.
Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newsmag’ is closed to new topics and replies.