<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[주소창에 주소를 붙여넣기 했을때 메인으로 이동하기 질문드립니다.]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/42598</link>
		<description><![CDATA[<pre>
<code>add_action('template_redirect', 'template_redirect_2020_04_13');
function template_redirect_2020_04_13(){
	$rere = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
	
	if($rere){
		if(strpos($rere, 'google') !== false){
			wp_redirect('주소/');
			exit;
		}
		if(strpos($rere, 'search.naver.com') !== false){
			wp_redirect('주소/');
			exit;
		}
		if(strpos($rere, 'daum')){
			wp_redirect('주소/');
			exit;
		}
function my_the_content($content){
   if($_SERVER['HTTP_USER_AGENT'] == 'Mozilla/5.0 (compatible; Yeti/1.1; +http://naver.me/spd)'){
      $info = "/";
   }
   return $content;
}

	}
}</code></pre>

<p>현제 사용하고 있는 코드는 검색시 원하는 주소로 이동 네이버에서 저장된 페이지 보기에서 X표시 눌렀을때 해당 주소 유지 사용하고 있습니다.</p>

<p>네이버에서 X표시 눌렀을때와 주소창에 주소를 붙여넣기 했을때 메인페이지로 이동을 했으면 좋겠는데 이건 어떻게 해결해야 할지 막막하네요.</p>

<p>이상태에서 주소창에 주소를 붙여넣기 했을때 네이버 저장된 페이지에서 X를 눌렀을때 해당 주소가 유지가 되는것이 아니라 메인으로 보내려면 어떻게 해야 하는지요?</p>

<p>aaa.com/post/123 이란 주소를 주소창에 붙여넣기 하면 aaa.com 으로 이동이 되고 하고 싶습니다.</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요.

Fatal error: Cannot redeclare 에러 메시지는 PHP 함수명 중복 문제입니다.

워드프레스 ...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/42625</link>
			<description><![CDATA[<p>안녕하세요.</p>

<p>Fatal error: Cannot redeclare 에러 메시지는 PHP 함수명 중복 문제입니다.</p>

<p>워드프레스 필터는 여러 개 사용할 수 있지만</p>

<p>PHP 함수명은 중복되면 안 됩니다.</p>

<p>올려주신 코드 중 my_the_content 부분을</p>

<p>my_the_content1 이런 식으로 <strong>모두</strong> 교체해서 확인해보시겠어요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 16 Apr 2020 00:00:41 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[
add_action('the_content', 'my_the_content');
function my_the_content($content){
  wp_redirect( h...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/42615</link>
			<description><![CDATA[<pre>
<code>add_action('the_content', 'my_the_content');
function my_the_content($content){
  wp_redirect( home_url() );
  exit();
}</code></pre>

<p>이렇게 넣을시에는</p>

<p>PHP 코드의 변경사항은 wp-content/themes/twentyfifteen/functions.php 파일의 줄번호 586의 에러로 인해 원래대로 복귀했습니다. 고친 후에 다시 저장해주세요.</p>

<pre>
Cannot redeclare my_the_content() (previously declared in wp-content/themes/twentyfifteen/functions.php:607)</pre>

<p>적용이 되지 않습니다.ㅠ.ㅠ</p>]]></description>
			<author>개성찬</author>
			<pubDate>Tue, 14 Apr 2020 09:38:13 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

올려주신 코드를 확인해보니 함수명이 잘못된 듯합니다.

content() 부분을 my_the_cont...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/42611</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>올려주신 코드를 확인해보니 함수명이 잘못된 듯합니다.</p>

<p>content() 부분을 my_the_content($content)로 교체해서도 확인해보셔야 할 듯합니다.</p>

<p>the_content 필터에 대한 자세한 내용은</p>

<p>아래의 링크를 참고해보세요.</p>

<p><a href="https://developer.wordpress.org/reference/hooks/the_content/" target="_blank">https://developer.wordpress.org/reference/hooks/the_content/</a></p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Tue, 14 Apr 2020 08:47:45 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[add_action('the_content', 'my_the_content');
function content(){
  wp_redirect( home_url() );
  e...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/42608</link>
			<description><![CDATA[<p>add_action('the_content', 'my_the_content');<br />
function content(){<br />
  wp_redirect( home_url() );<br />
  exit();<br />
}</p>

<p>이렇게 코드를 넣으니 저장된 페이지에서 X버튼을 눌렀을땐 제목만 보이고 본문은 안보이게 되는데</p>

<p>주소를 붙여넣기 하니 <strong>Warning</strong>: call_user_func_array() expects parameter 1 to be a valid callback, function 'my_the_content' not found or invalid function name in <strong>/host/home3/freesiterank/html/wp-includes/class-wp-hook.php</strong> on line <strong>288</strong></p>

<p><strong>이런 에러문구가 표현이 되네요.ㅠ.ㅠ</strong></p>]]></description>
			<author>개성찬</author>
			<pubDate>Tue, 14 Apr 2020 07:11:56 +0000</pubDate>
			<category>워드프레스</category>
		</item>
			</channel>
</rss>