You are using the count() function to determine $liked_count. This function is meant to determine the number of items in an array. But it appears that the value stored in the liked_count postmeta is not an array, but an integer count. When you do count( $p ) where $p is an integer, you get 1 no matter what the integer is.
Try this instead:
$liked_count = (int) get_post_meta( $id, 'liked_count', true );
Related Posts:
- How to override normal WordPress search in Buddypress? [closed]
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- How to notify users of blog updates a la Admin Plugin Update notifications?
- plugin to search entire posts, blogs, forum, users [closed]
- How to get member list based on role by using buddypress?
- Possible to add a language file to a plugin without adding .po/.mo files to plugin directory?
- Two people sharing user in WordPress [closed]
- Wp favorite posts get user favorites in profile using buddypress [closed]
- rt media plugin count not working in shortcode [closed]
- Integrate BuddyPress & Facebook
- Add An Activity Filter By User Id In Buddypress Plugin
- Buddypress – Add the post_id in the bp_activity_add function
- After plugin activation all users marked as Spam
- media page returnig to 404 in rtmedia [closed]
- Implementing an image hosting website using WordPress? [closed]
- Duplicate New User Registration notices (BuddyPress and bbPress both installed)
- Remove / overwrite some functions in buddypress.js
- How to override the Buddypress bp-members folder’s file?
- BuddyPress activity on edit post for a CPT
- BuddyPress: filter member based on Xprofile Field
- override function from my plugin [closed]
- How to enable WPML in BuddyPress Multilingual Plugin in a single website? [closed]
- Do WordPress plugins suport multisite site?
- BuddyPress admin bar links are broken [closed]
- Using BuddyPress > ‘Register page’ [closed]
- Bulk User Deletion
- Summary and Comments on Main landing Page
- HTTP Error upload ( localhost )
- Limiting buddy press features based on membership level (PMPro)
- How do I add languages?
- There was a problem uploading the cover image in buddypress, while uploading profile image?
- Buddypress Member list not showing admin and mods
- Edit Buddypress Groups Activity Page Text [closed]
- How to Change MU/BuddyPress Group Blog New Installation Defaults [closed]
- how do you point ‘screen_function’ to a function in the same class? [closed]
- Buddypress Plugin for register user from other site’s [closed]
- I want to remove the register/login WordPress top bar from my website
- How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?
- how to set approval of admin for wordpress posts submitted by the user?
- BuddyPress group filter
- Different login and logout for wp-admin while using buddypress
- How to create a buddypress group automatically if a topic is created
- Custom Login and Password Reset for BuddyPress Website
- Randomly display activity posts on home page with buddypress
- Proper Way to Modify Plugin
- How to get a variable number of posts per post type on the main loop?
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Filter Hook on plugin update
- Generic plugin (de)activation hook?
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- How to prefix `attachment` permalinks with `attachment`?
- How do I register a stylesheet inside a WordPress widget?
- List users except current user using wp_dropdown_user? [closed]
- Edits to plugin not taking effect
- Multisite Backup Plugin [closed]
- WordPress plugin for affiliate referral system
- adding a new value to a serialized array in WP_option table
- WordPress 5 upgrade: until when is it safe to keep project running in 4.x?
- Write to / remove from default .htaccess file from plugin?
- How to Use Parameters with a Do_Action Function Within PHP Tags
- Landing Page Redirect Chain | http->https->https www
- How do I pass a post ID to the page URL?
- Need to change url paramenter of share product pintrest [closed]
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- How To Extend A WordPress Plugin Without Losing Your Changes [duplicate]
- WordPress call_user_func_array() expects parameter 1 to be a valid callback, class
- Why is my custom post type not being activated on plug-in activation?
- Where to find the code used to render a page that has a shortcode and a template defined?
- WordPress User Post Products
- How to find out whether a plugin is used in pages or posts?
- How can I load the css and jquery explicitly for the login screen
- preg_replace() No ending delimiter ‘.’ found [closed]
- How to approach displaying products with no shopping cart plugin or post type?
- Linking form to user meta fields
- Remove all messages, when untrash a post
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- Looping the data from WordPress database using foreach
- Rename a folder via HTML POST request
- How to display latest viewed post by logged user?
- path of wp-content directory when we are on some plugin
- How to make a page both “private” and “password protected”
- How to duplicate a product page
- what is the best way to create a premium plugin while also protecting your code
- Get url of selected gallery images?
- Show image or notification on specific blog in multisite
- Child Theme Changes Are Not Reflecting In Parent Theme
- How to use categories in the URL with Advanced Custom Fields?
- Plugin Breaking WordPress Login
- Multiple thumbnails and one gallery
- How can I allow for the password protect feature to allow visitors to enter any number at all?
- Checking url from plugin [duplicate]
- Gutenberg: Dynamic Block – Show saved data in the editor
- Trying to Understand Shortcodes.
- Is there a way to stop the theme and especially plugins listed?
- How to disable plugin capability : “create new category”
- Scripts don’t enqueue after removing plugin
- Categories not showing when all of the posts are private
- How to create a “Most Popular” & “Latest” TAB in WordPress
- Multilingual WordPress Website with multiple source languages
- WordPress Multisite Plugin Activation Issue