<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[메뉴에 알림/댓글 표시]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/54558</link>
		<description><![CDATA[<p>안녕하세요</p>

<p>이전글을 검색하여 메뉴에 숏코드를 추가하여 댓글/알림 표시를 하고있습니다.</p>

<p>https://imgur.com/1ioH1vo</p>

<p>메뉴명 및 적용 숏코드는 아래와 같습니다.</p>

<p>내 정보 [cosmosfarm_members_unread_notifications_count][cosmosfarm_members_unread_messages_count]</p>

<p> </p>

<p>근데 쪽지도 1개가 오고, 알림도 1개가 있다면 스크린샷처럼 각각 동그란 표시가 2개 뜨는데 이걸 하나로 합쳐서 출력 가능한지요?</p>

<p>예: 쪽지 1개, 알림 1개 총 2개의 알림이 있을 시 동그란 알림에 숫자 2로 표시</p>

<p> </p>

<p>감사합니다. </p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[확인 결과 입니다.

코드가 잘못된 것은 아니었습니다.

알림쪽 필터를 이용하다 보니 알림페이지에서 3...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54583</link>
			<description><![CDATA[<p>확인 결과 입니다.</p>

<p>코드가 잘못된 것은 아니었습니다.</p>

<p>알림쪽 필터를 이용하다 보니 알림페이지에서 3개로 표시 되었을 때</p>

<p>메뉴 쪽에서도 3개로 표시되었습니다.</p>

<p> </p>

<p>해당 부분은 아래와 같이 숏코드로 처리하였습니다.</p>

<pre>
<code>add_shortcode('cosmosfarm_members_unread_total_count', 'cosmosfarm_members_unread_total_count');
function cosmosfarm_members_unread_total_count($args=array()){
	$unread_count = 0;
	$user_id = 0;
	
	if(!$user_id){
		$user_id = get_current_user_id();
	}
	
	if($user_id){
		$unread_messages_count = intval(get_user_meta($user_id,  'cosmosfarm_members_unread_messages_count', true));
		$unread_notifications_count = intval(get_user_meta($user_id,  'cosmosfarm_members_unread_notifications_count', true));
		$unread_count = $unread_messages_count + $unread_notifications_count;
	}
	
	return '&lt;span class="cosmosfarm-members-unread-messages-count'.($unread_count?'':' display-hide').'"&gt;' . $unread_count . '&lt;/span&gt;';
}</code></pre>

<p>숏코드는 [cosmosfarm_members_unread_total_count] 입니다.</p>

<p> </p>

<p>목적과 상황을 상세히 적어주시면 보다 양질의 답변을 받으실 수 있습니다.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 09 Aug 2021 10:01:37 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요

여전히 3으로 표시됩니다.

여기는 공개적인 댓글이라 테스트계정과 홈페이지링크를 드리기...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54581</link>
			<description><![CDATA[<p>안녕하세요</p>

<p>여전히 3으로 표시됩니다.</p>

<p>여기는 공개적인 댓글이라 테스트계정과 홈페이지링크를 드리기 힘들 것 같은데 어떻해야 할까요?</p>

<p>jonghomail@gmail.com 으로 연락주시겠어요? 또는 코스모스팜 회원관리 테스트 서버 있으시면 실험 부탁드립니다.</p>

<p>감사합니다...</p>]]></description>
			<author>미어캣</author>
			<pubDate>Mon, 09 Aug 2021 08:32:53 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[아래코드로 적용해보시겠어요? 부정확한 안내 죄송합니다.


add_filter('cosmosfarm_members_unread_no...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54578</link>
			<description><![CDATA[<p>아래코드로 적용해보시겠어요? 부정확한 안내 죄송합니다.</p>

<pre>
<code>add_filter('cosmosfarm_members_unread_notifications_count', 'cosmosfarm_memebers_notification_0809', 10, 1);
function cosmosfarm_memebers_notification_0809($unread_noti_count){
	$unread_messages_count = 0;
	$user_id = get_current_user_id();

	if($user_id){
		$unread_messages_count = intval(get_user_meta($user_id,  'cosmosfarm_members_unread_messages_count', true));
	}
	if($unread_messages_count){
		$total_unread_count = $unread_noti_count + $unread_messages_count ;
	}
	else{
		$total_unread_count = $unread_noti_count;
	}

	return $total_unread_count;
}</code></pre>

<p>위 코드를 적용했는데도 안된다면 테스트 계정과 해당 페이지 링크 남겨주시면</p>

<p>직접 살펴보겠습니다.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 09 Aug 2021 07:33:43 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요

해당파일로 업데이트하였으나 여전히 4가 아닌 3으로 출력됩니다...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54575</link>
			<description><![CDATA[<p>안녕하세요</p>

<p>해당파일로 업데이트하였으나 여전히 4가 아닌 3으로 출력됩니다...</p>]]></description>
			<author>미어캣</author>
			<pubDate>Mon, 09 Aug 2021 06:51:21 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[오타가 있었습니다. 죄송합니다.

아래 코드로 변경하여 적용해보시겠어요?


add_filter('cosmosfarm_m...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54574</link>
			<description><![CDATA[<p>오타가 있었습니다. 죄송합니다.</p>

<p>아래 코드로 변경하여 적용해보시겠어요?</p>

<pre>
<code>add_filter('cosmosfarm_members_unread_notifications_count', 'cosmosfarm_memebers_notification_0809', 10, 1);
function cosmosfarm_memebers_notification_0809($unread_noti_count){
	$unread_messages_count = 0;
	$user_id = get_current_user_id();

	if($user_id){
		$unread_messages_count = intval(get_user_meta($user_id,  'cosmosfarm_members_unread_messages_count', true));
	}
	if($unread_noti_count){
		$total_unread_count = $unread_noti_count + $unread_messages_count ;
	}
	else{
		$total_unread_count = $unread_noti_count;
	}

	return $total_unread_count;
}</code></pre>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 09 Aug 2021 05:52:28 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요

위에 말씀해주신 내용으로 적용하였더니, 쪽지 알림은 포함되지 않습니다.

예를 들어 쪽지...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54567</link>
			<description><![CDATA[<p>안녕하세요</p>

<p>위에 말씀해주신 내용으로 적용하였더니, 쪽지 알림은 포함되지 않습니다.</p>

<p>예를 들어 쪽지알림이 1개이고, 글 알림이 3개이면 총 4라고 표시되어야 하는데 3으로만 표시됩니다.</p>

<p> </p>

<p>https://imgur.com/k163l4K</p>

<p> </p>

<p>감사합니다.</p>]]></description>
			<author>미어캣</author>
			<pubDate>Mon, 09 Aug 2021 02:13:20 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

두 개는 각각의 숏코드로 분리되어 있어

올려주신 내용대로 출력하고자 하면 코드를 새...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/54562</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>두 개는 각각의 숏코드로 분리되어 있어</p>

<p>올려주신 내용대로 출력하고자 하면 코드를 새로 작성하여야 합니다.</p>

<p> </p>

<p>wp-content/plugins/cosmosfarm-members/cosmosfarm-members.php 파일 중 아래 코드를 찾아서</p>

<pre>
<code>return '&lt;span class="cosmosfarm-members-unread-notifications-count'.($unread_count?'':' display-hide').'"&gt;' . $unread_count . '&lt;/span&gt;';
</code></pre>

<p>아래 코드처럼 변경해보시겠어요?</p>

<pre>
<code>$unread_count = apply_filters('cosmosfarm_members_unread_notifications_count', $unread_count);
return '&lt;span class="cosmosfarm-members-unread-notifications-count'.($unread_count?'':' display-hide').'"&gt;' . $unread_count . '&lt;/span&gt;';</code></pre>

<p> </p>

<p>그 다음 테마 functions.php 아래나 코드스니펫 플러그인을 이용해 아래의 코드를 삽입해주세요.</p>

<pre>
<code>add_filter('cosmosfarm_members_unread_notifications_count', 'cosmosfarm_memebers_notification_0809', 10, 1);
function cosmosfarm_memebers_notification_0809($unread_noti_count){
	$unread_count = 0;
	$user_id = get_current_user_id();

	if($user_id){
		$unread_count = intval(get_user_meta($user_id,  'cosmosfarm_members_unread_messages_count', true));
	}
	if($unread_count){
		$total_unread_count = $unread_noti_count+$unread_count;
	}
	else{
		$total_unread_count = $unread_noti_count;
	}

	return $total_unread_count;
}</code></pre>

<p> </p>

<p>이제 원하시는 위치에 아래 숏코드를 삽입하면 두 알람이 합쳐져서 출력됩니다.</p>

<pre>
<code>[cosmosfarm_members_unread_notifications_count]</code></pre>

<p> </p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 09 Aug 2021 01:44:54 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>