How to display the current counts of followers and following? – UserPro Forums https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/feed/ Mon, 29 Apr 2024 00:14:05 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15195 <![CDATA[How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15195 Sun, 29 Dec 2013 14:18:06 +0000 Millen How could I display the current counts of followers, following and bookmarks in the front end.

I am currently developing my own theme and would like to know what PHP code is necessary to display total different counts for the current active/logged in user in the frontend.

example:

Bookmarks (9) | Following (89) | Followers (32)

I just need to display the actual numbers (counts).

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15216 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15216 Sun, 29 Dec 2013 21:15:07 +0000 admin This is fairly simple with PHP + UserPro API. Here are answers:

The UserPro API makes it so easy to access and display any functions quickly in your app / integration. First, the following/followers count:

To display the count of following for a user:

get_current_user_id() is current logged in user ID. I assume you will check that user has logged in already

To display the count of followers for a user:

These will return the count in PLAIN format. You can customize everything else.

To show total number of pages that user has bookmarked:

You will need the updated version of Bookmarks addon API

You can access functions with one line using the API. A complete guide to the API will be available soon as well.

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15513 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15513 Wed, 01 Jan 2014 10:01:13 +0000 Millen That did actually not work for me.

Do you think It matters that I got my menu wrapped with?

<?php if (is_user_logged_in() ) { //only logged in user can see this ?>

Here goes my menu and follow/bookmark counts

<?php } ?>

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15520 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15520 Wed, 01 Jan 2014 12:04:53 +0000 admin I just tested it and the codes worked perfectly. Please show your full code.

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15537 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15537 Wed, 01 Jan 2014 17:29:11 +0000 Millen Could not get the code wrap to work in this bbpress forum…strange…feel free to correct the post.

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15625 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15625 Thu, 02 Jan 2014 15:04:19 +0000 admin Please do not paste the whole, just show me your API usage, I already had example above for you. 🙂

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15644 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-15644 Thu, 02 Jan 2014 16:30:33 +0000 Millen It’s impossible for me to post code in this forum.

Please refer to the pictures instead:

http://whoisfreddie.com/images/code-userpro.png

http://whoisfreddie.com/images/my-design-html.png

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16371 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16371 Tue, 07 Jan 2014 04:02:34 +0000 Millen Does anyone know what I am doing wrong?

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16377 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16377 Tue, 07 Jan 2014 08:06:27 +0000 admin I just tested this code and it worked perfectly fine.

I am sorry, can someone please try that code as php code in theme (with social active) to get the count of following users?

]]>
https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16380 <![CDATA[Reply To: How to display the current counts of followers and following?]]> https://forum.userproplugin.com/forums/topic/display-current-counts-followers-following/#post-16380 Tue, 07 Jan 2014 08:19:18 +0000 Nexnivis I’ve tried and it worked for me too

]]>