<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									CPT added to total blog articles in user activity - How-to and Troubleshooting - wpForo 2.0				            </title>
            <link>https://wpforo.com/community/how-to-and-troubleshooting-2/cpt-added-to-total-blog-articles-in-user-activity/</link>
            <description>Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Thu, 21 May 2026 10:28:31 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: CPT added to total blog articles in user activity</title>
                        <link>https://wpforo.com/community/how-to-and-troubleshooting-2/cpt-added-to-total-blog-articles-in-user-activity/#post-53266</link>
                        <pubDate>Fri, 23 Apr 2021 05:39:02 +0000</pubDate>
                        <description><![CDATA[You should use this code. Put it in the functions.php file of your active WordPres theme or use the Code Snippets plugin to insert it into your website.
Don&#039;t forget to add custom post type...]]></description>
                        <content:encoded><![CDATA[<p>You should use this code. Put it in the functions.php file of your active WordPres theme or use the <a href="https://wordpress.org/plugins/code-snippets/" target="true">Code Snippets plugin</a> to insert it into your website.</p>
<p>Don't forget to add custom post types in the <span>$post_type = </span> array after the 'post'. Separate post types by comma, make sure you use the post type name not the post type titles. Post type names don't have upper case chars and spaces:</p>
<pre style="color: #000000;font-size: 12.0pt" contenteditable="false"><span style="color: #0000e5;font-style: italic">add_filter</span>(<span style="color: #c64741">'get_usernumposts'</span><span style="color: #000080">, </span><span style="color: #c64741">'wpforo_user_custom_post_type_count'</span><span style="color: #000080">,10, 4</span>)<span style="color: #313131">;<br /></span><span style="color: #008d00;font-weight: bold">function </span><span style="color: #0000e5;font-weight: bold">wpforo_user_custom_post_type_count</span>( <span style="color: #4985c9;font-weight: bold">$count</span><span style="color: #000080">, </span><span style="color: #4985c9;font-weight: bold">$userid</span><span style="color: #000080">, </span><span style="color: #4985c9;font-weight: bold">$post_type</span><span style="color: #000080">, </span><span style="color: #4985c9;font-weight: bold">$public_only </span>)<span style="color: #5163ac">{<br /></span><span style="color: #5163ac"><br /></span><span style="color: #5163ac">   </span><span style="color: #4985c9;font-weight: bold">$post_type </span><span style="color: #000080">= </span><span style="color: #313131">; </span><span style="color: #e19312;font-style: italic">//add comma separated custom post types<br /></span><span style="color: #e19312;font-style: italic"><br /></span><span style="color: #e19312;font-style: italic">   </span><span style="color: #008d00;font-weight: bold">if</span>( <span style="color: #0000e5;font-style: italic">function_exists</span>(<span style="color: #c64741">'WPF'</span>) )<span style="color: #5163ac">{<br /></span><span style="color: #5163ac">      </span><span style="color: #008d00;font-weight: bold">global </span><span style="color: #4985c9;font-weight: bold">$wpdb</span><span style="color: #313131">;<br /></span><span style="color: #313131">      </span><span style="color: #008d00;font-weight: bold">if</span>(<span style="color: #0000e5;font-style: italic">is_wpforo_page</span>())<span style="color: #5163ac">{<br /></span><span style="color: #5163ac">         </span><span style="color: #4985c9;font-weight: bold">$where </span><span style="color: #000080">= </span><span style="color: #0000e5;font-style: italic">get_posts_by_author_sql</span>( <span style="color: #4985c9;font-weight: bold">$post_type</span><span style="color: #000080">, </span><span style="color: #008d00;font-weight: bold">true</span><span style="color: #000080">, </span><span style="color: #4985c9;font-weight: bold">$userid</span><span style="color: #000080">, </span><span style="color: #4985c9;font-weight: bold">$public_only </span>)<span style="color: #313131">;<br /></span><span style="color: #313131">         </span><span style="color: #4985c9;font-weight: bold">$custom_count </span><span style="color: #000080">= </span><span style="color: #4985c9;font-weight: bold">$wpdb</span><span style="color: #000080">-&gt;</span><span style="color: #0000e5;font-style: italic">get_var</span>( <span style="color: #c64741">"</span><span style="color: #e32c20">SELECT COUNT(*) FROM </span><span style="color: #4985c9;font-weight: bold">$wpdb</span><span style="color: #000080">-&gt;</span><span style="color: #0000e5;font-style: italic">posts </span><span style="color: #e32c20;font-weight: bold">$</span><span style="color: #4985c9;font-weight: bold">where</span><span style="color: #c64741">" </span>)<span style="color: #313131">;<br /></span><span style="color: #313131">         </span><span style="color: #008d00;font-weight: bold">if</span>( <span style="color: #4985c9;font-weight: bold">$custom_count </span>) <span style="color: #008d00;font-weight: bold">return </span><span style="color: #4985c9;font-weight: bold">$custom_count</span><span style="color: #313131">;<br /></span><span style="color: #313131">         </span><span style="color: #008d00;font-weight: bold">return </span><span style="color: #4985c9;font-weight: bold">$count</span><span style="color: #313131">;<br /></span><span style="color: #313131">      </span><span style="color: #5163ac">}<br /></span><span style="color: #5163ac">   }<br /></span><span style="color: #5163ac">}<br /></span></pre>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/how-to-and-troubleshooting-2/">How-to and Troubleshooting - wpForo 2.0</category>                        <dc:creator>Robert</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/how-to-and-troubleshooting-2/cpt-added-to-total-blog-articles-in-user-activity/#post-53266</guid>
                    </item>
				                    <item>
                        <title>CPT added to total blog articles in user activity</title>
                        <link>https://wpforo.com/community/how-to-and-troubleshooting-2/cpt-added-to-total-blog-articles-in-user-activity/#post-53216</link>
                        <pubDate>Wed, 21 Apr 2021 06:51:49 +0000</pubDate>
                        <description><![CDATA[Hello
Is it possible that in user activity the custom post types are added to the total blog articles written by a user? 
Thanks
 Screenshot_1.jpg]]></description>
                        <content:encoded><![CDATA[<p><span>Hello</span></p>
<p><span>Is it possible that in user activity the custom post types are added to the total blog articles written by a user? </span></p>
<p><span>Thanks</span></p>
<div id="wpfa-0" class="wpforo-attached-file"><a class="wpforo-default-attachment" href="//wpforo.com/wp-content/uploads/wpforo/default_attachments/1618987909-Screenshot_1.jpg" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> Screenshot_1.jpg</a></div>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/how-to-and-troubleshooting-2/">How-to and Troubleshooting - wpForo 2.0</category>                        <dc:creator>jarruego</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/how-to-and-troubleshooting-2/cpt-added-to-total-blog-articles-in-user-activity/#post-53216</guid>
                    </item>
							        </channel>
        </rss>
		