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 8438109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:37:01+00:00 2026-06-10T07:37:01+00:00

I use a point system plugin for WordPress. By adding this code to the

  • 0

I use a point system plugin for WordPress. By adding this code to the author.php page:

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

It will echo X Points. This is the points of that respective author. When I add the same code to single.php (post page), it echos the logged in user’s points, and if not logged in, it returns blank.

How can I alter this code so that it will function properly on the single.php page too? This would mean that it would echo the points of the author of that post.

  • 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-10T07:37:03+00:00Added an answer on June 10, 2026 at 7:37 am

    Just call get_the_author_meta from within the loop.

    So, you just need to test if you have a currently signed in user, if not use the post author instead. Something like this.

    <?php
    if(!$authordata->ID)
      cp_displayPoints(get_the_author_meta('ID'));
    else
      cp_displayPoints($authordata->ID);
    ?>
    

    EDIT:

    To display only the post author’s ID, just use

    <?php cp_displayPoints(get_the_author_meta('ID')); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use next code to print current time Calendar cal = Calendar.getInstance(); System.out.println(cal.getTime()); I
I'm working on a particle system and point sprites would be nice to use.
I have some code (it's part of a wordpress plugin) which takes a text
I am trying to use the Savage Beast 2 plugin in my project. This
Is it possible to change C#'s built-in Vector3 struct to not use floating point
I'm getting illegal use of floating point error on compiling the following program. Please
My question is next: How to use pixel instead point for control? For example
Can anyone point me to some documentation about how I can use an Iso
In performance point of view what should you use Nested foreach's or lambda/linq queries?
Can anyone point me to an example on how to use CURRENT_DATE in a

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.