http://wpdocs.osdn.jp/%E6%A4%9C%E7%B4%A2%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%AE%E4%BD%9C%E6%88%90
を参考に、テーマに検索結果テンプレートを作成(あるいは存在するテーマもある)し、その中で表示しているコード部分で文字列置換すればいいのではないかなと思います。
Twenty Sixteen テーマならば、search.php が検索結果テンプレートであり、
たとえば検索結果のコンテンツに関しての置換なら
function the_content_replace($content){
$content = str_replace("http://localhost","http://hogege", $content);
return $content;
}
add_filter('the_content', 'the_content_replace');
while ( have_posts() ) : the_post();
なんかでリンク変更できたりするんじゃないかなーと思います。
kimipooh様 ご返答ありがとうございます。
なるほど、seaarch.phpの the_contentを編集すればよいのですね。
なにか難しく考えていました。
上記のサイトも参考に書き換えを行おうと思います。
有難う御座います。
Avadaというテーマを利用していたのですが
wp-content/themes/Avada/templatesのblog-layout.php内の
157行目あたりの
// Render the post title
//From here
$this_search_title=avada_render_post_title( get_the_ID() );
$beforeurl='正規表現';
$afterurl='置き換える文字列';
$this_search_title = preg_replace($beforeurl,$afterurl, $this_search_title);
echo $this_search_title;
//To here
// Render post meta for grid and timeline layouts
if ( $blog_layout == 'grid' ||
$blog_layout == 'timeline'
というように書き換えることで無事完了しました。
有難う御座います。