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
- Woocommerce – Specific template for product category? [closed]
- WooCommerce – How to Add a Custom Field to Cart Items and Cart Totals [closed]
- Show Similar Post Titles ( Similar to Stack Exchange )
- How to parse nested shortcodes?
- Custom wp_nav_menu output (displaying all child elements of top menu element in current branch)
- Removing user contact methods works from functions.php but not from a plugin
- Help!! I Screwed up my WP
- Dynamic homepage according to user role
- How to extract images of post and pages excluding header and logo image in wordpress?
- Subscribe2 Configuration
- Does the WordPress API have Modal Dialogs
- Dropzone.js and wordpress plugin
- Filter or action hook to insert content on admin pages before tag
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Pass a php string to a javascript variable
- How to upload images to WP Panel keeping correct folder in FTP
- Email Bounce Address
- Can someone please tell me what is wrong with my plugin?
- Trigger Elementor Popup via code [closed]
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- Can’t view ‘More details’ on plugins pop up is blank and Authy pop up
- Installing Jplayer in WordPress
- Does plugin’s uninstall.php file have access to the plugin ‘s object?
- Related posts widget or plugin needed
- Implementing an “Email this” button?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Use conditional logic for woocommerce variable product
- How to customize a title by passing query string?
- Remove Advanced Custom Fields plugin for client?
- Order posts by meta key ( Using ACF )
- Get param from shortcode in plugin function
- Customizing $product->get_title() function
- Change website directory safely to add a static page on startup
- Plugin permissions for Editor role
- How to add an admin alert for missing plugins
- After installing JetPack, can I delete the WordPress stats plugin?
- how to create hierachial taxonomy and manage under single post type?
- How can I disable new plugin and theme install, but allow updates?
- Dynamic URL Issue on SEO Scan
- WordPress built-in compression of images? How well does it compare to Photoshop or Shortpixel?
- Ajax response returns html code instead of user data
- Registered sidebar area is not shown from plugin.
- get/show Last ID
- Building a Article Library within WP?
- What is the best practice for making a WP plugin that I want to develop responsive?
- Form tries to download a file on submit
- Undefined index – get_option
- Auto-login from backend
- Plugins don’t show up after renaming plugins folder
- Use of apply_filter in plugin/widget class
- How to use wp_http with https-pages?
- No plugin updates after moving wp-config.php above root map
- Snippet displaying LearnDash parent course title with lesson title [closed]
- Want to show pop up image on home page every time when i refresh it [closed]
- woocommerce show cities state as dropdown list
- FacetWP custom display based on post type [closed]
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]