Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:38:50+00:00 2026-06-10T01:38:50+00:00

The following code is for a WordPress plugin, it displays points and tank of

  • 0

The following code is for a WordPress plugin, it displays points and tank of a user:

<?php
if(function_exists('cp_displayPoints') && $authordata->ID){
  echo '<span class="cubepoints_buddypress">'; cp_displayPoints($authordata->ID); echo '</span>';
  if(function_exists('cp_module_ranks_getRank')) echo ' <span class="cupepoints_buddypress_rank">'.cp_module_ranks_getRank($authordata->ID).'</span>';
}
?>

I am trying to extract these two echo functions from the If statement but only succeeded with one of them. I can echo the points like this:

<?php cp_displayPoints($authordata->ID); ?>

Works fine. Now I tried doing the same with the second echo:

<?php cp_module_ranks_getRank($authordata->ID); ?>

But it did not work. Obviously, there is some basic thing that I am missing here. Do you know what it is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:38:52+00:00Added an answer on June 10, 2026 at 1:38 am

    The first one likely prints directly to output, while the second returns its value. So, you need to echo() the second one, just as they’re doing in your sample code:

    <?php echo cp_module_ranks_getRank($authordata->ID); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I inserted the following code in a WordPress plugin: wp_deregister_script('jquery'); wp_register_script('jquery', http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js); wp_enqueue_script('jquery'); The
I am using a wordpress plugin that requires the following code in my template:
I am using wordpress and on the page sidebar.php I have the following code:
I have the following code in header.php to echo the body's id: <body id=<?php
The following code will add the categories selector widget to the WordPress Page editor
I am working on a WordPress site and I have placed the following code
I am trying to post some java code snippets on wordpress.com using the following
Following code is generated by a for loop. <form action=saveresponse.php method=POST name=mainForm> <input class=cbox_yes
I have a website with wordpress 3.0. I noticed that /wp-admin displays the following
I installed Wordpress User Photo plugin that allows to show an authors photo. So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.