Hi,
I have some php code that only outputs a link to another website only if it is the homepage.
I am running the php code widget and sticking it in a footer column, but I really want to run the php code in the socket (very bottom beyond below the footer section).
If you’re curious here is the code I want to run in the socket:
<?php
if (is_front_page())
{
echo “my link text“;
}
?>
If you have a better idea on how to accomplish this, I would greatly appreciate it.
Thank you!
Hi 118group!
Please add following code to Functions.php file in Appearance > Editor
add_filter("kriesi_backlink","new_nolink");
function new_nolink(){
if(is_home()){
$kriesi_at_backlink = "<a href='http://kriesi.at'>Your text here</a> ";
}
return $kriesi_at_backlink;
}
It will replace Kriesi.at backlink on home page.
Best regards,
Yigit
Hi Yigit,
Thank you for the quick response. Will changing the functions.php be overwritten on future theme updates? Is it possible to avoid creating a child theme, and just create a plugin to accomplish this?
Thanks again… Dale
Hi!
Yes, it will be overwritten when you update the theme. Please use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/
Cheers!
Yigit