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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:51:50+00:00 2026-06-01T17:51:50+00:00

When I call get_post_custom in a loop, it works properly. But it prints 38

  • 0

When I call get_post_custom in a loop, it works properly. But it prints 38 on my screen. Is it a wp bug or what? How can I fix it?

More Info:
It happens when I call get_post_meta as well. I am using custom field template plugin.

$args = array(
        'post_type' => 'attendeeaddress',
        'meta_query' => array(
            array(
                'key' => 'MEETING_ID',
                'value' => $meeting_id,
                'meta_compare' => '='
            )
        )
    );
    $wpquery = new WP_Query($args);
    $addresses = array();
    while ( $wpquery->have_posts() ) : $wpquery->the_post();
        $custom_val = get_post_custom(the_ID());
        $addresses[] = array(
            "address" => $custom_val["MEETING_ADDRESS"][0],
            "meeting_id" => $meeting_id,
            "lat" => $custom_val["MEETING_LAT"][0],
            "lon" => $custom_val["MEETING_LON"][0],
            "name" => $custom_val["NAME"][0]
        );
    endwhile;

    return $addresses;
  • 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-01T17:51:51+00:00Added an answer on June 1, 2026 at 5:51 pm

    It’s because the_ID(); actually “echoes” the value.

    To just collect the value, use get_the_ID();

    http://codex.wordpress.org/Function_Reference/the_ID
    http://codex.wordpress.org/Function_Reference/get_the_ID

    • you have to use this in the loop only.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm outside the loop and want to call a custom value featvideo and display
When I call get_d() on a MPQ variable in the GMP library, I only
I'm trying to call Get-WMIObject (gwmi) on multiple computers selected via Get-ADComputer as a
I have the code below: from the getData function im trying to call get_xml
The following JQuery get call: var doc_root = document.location.hostname + :8082; var fw_script =
I have a website where an ajax call will get some Json data from
I use asp.net 2 and need to consume a 3rd party HTTP GET call
Anytime I call cvNamedWindow I get a segmentation fault and I don't know why
I am exploring jQuery.get() ajax call to load a website content into my HTML
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }

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.