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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:27:49+00:00 2026-06-11T11:27:49+00:00

I have a global post query running, but for some reason my custom meta

  • 0

I have a global post query running, but for some reason my custom meta is not being output. When I try to call it inside a typical WordPress loop it works, but not in my code below. Is there any reason why this would be the case? Been trying to figure it out for an hour now….

<?php global $post; $cntr = 0; $myposts = get_posts('&post_type=go-deeper&posts_per_page=12'); 
foreach($myposts as $post) : setup_postdata($post);?>
<li class="<?php echo "slide_" . $cntr; ?>"><a href="<?php echo get_post_meta($post->ID, 'll_deeper_link', true); ?>"><?php the_post_thumbnail('full'); ?></a></li>
<?php $cntr++; ?>
<?php endforeach; ?>
  • 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-11T11:27:50+00:00Added an answer on June 11, 2026 at 11:27 am

    I just re-wrote the query and it works now:

        <?php if(have_posts()): $cntr = 0;?>
        <?php query_posts('&post_type=go-deeper&posts_per_page=12');?>
        <?php while(have_posts()):the_post();?>
        <?php $deeper_link = get_post_meta( get_the_ID(), 'll_deeper_link', true ); ?>
        <li class="<?php echo "slide_" . $cntr; ?>">
          <a href="<?php echo $deeper_link;?>"><?php the_post_thumbnail('full'); ?></a>
        </li>
        <?php $cntr++; ?>
        <?php endwhile;?>
        <?php wp_reset_query(); ?>
        <?php endif;?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the code that generates random posts from the specific tag, global $post;
For some reason this query is only returning the 10 most recently published results,
I have created a custom post type calles articles and a custom category like
I have this code add_action( 'delete_post', 'my_delete_function' ); function my_delete_function() { global $wpdb; $wpdb->query(
For some reason, I cannot get WP_Query to return the custom field values of
I have the following query for getting the latest comments: global $wpdb; $sql =
I have the following method in a CI model: function getPostTitle($post_slug) { global $post;
I'm using a pagination query in my loop. But I need it to output
I have a wordpress page which has two loops like so... <?php global $post;
hello all i want to retrieve my all the wall post that i have

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.