replace link
-
i have the next function
<?php $hide = array('<a href="https://web.imobtour.ro/rent-a-car/" title="Rent-A-Car">Rent-A-Car</a>'); $replace_with = '<a href="https://rac.imobtour.ro" title="Rent-A-Car" target="_blank">Rent-A-Car</a>'; function censor($context) { global $hide, $replace_with; foreach ($hide as $words) { $context = eregi_replace($words, $replace_with, $context); } return $context; } ?>
i want to replace a link from the navigation – pages
and i use
<?php censor(wp_list_pages('depth=1&title_li=' )); ?>
so i don’t create a manually button.
is there a script in wordpress codex that cand do this ? so i don’t have edit the theme code?
what is bad in my “script” ( is not made by me ?? )
i get this:
Warning: Invalid argument supplied for foreach() in /home/btour/public_html/web/wp-content/themes/default/header.php on line 36
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘replace link’ is closed to new replies.