[resolved] c2c_get_custom() and displaying more than one value (3 posts)

  1. syncbox
    Posted 6 years ago #

    I'm trying to display a meta key value (Org-Logo) using c2c's c2c_get_recent_custom() function outside of the main display page's loop (per instructions for plugin). Here's my markup:

    echo c2c_get_recent_custom('Org-Logo','<img src="http://example.org/wp-content/uploads/','" class="thumbsize" />','',' ','',300,false,'DESC',true); ?>

    to display up to 300 logos, arranged via the thumbsize class.

    I get nothing. However, if I remove all but the first 5 vars, I get ONE logo (the last one added)

    I believe it should work, but it doesn't. The documentation says that $limit is: Optional argument. The limit to the number of custom fields to retrieve.

    any suggestions or ideas? What am I doing wrong?

  2. MichaelH
    Posted 6 years ago #

    Have you looked at Custom Fields and some of the info there to retrieve and display custom fields.

  3. syncbox
    Posted 6 years ago #

    Got this working....

     $lastposts = get_posts('numberposts=300&child_of=323&post_type=page&post_parent=323&orderby=rand');
     foreach($lastposts as $post) :
     <a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php echo c2c_get_custom('Org-Logo','<img src="http://domainobscured.org/wp-content/uploads/','" class="thumbsize" alt="" />','',' ',''); ?></a>
     <?php endforeach; ?>

    thanks for all your help!

Topic Closed

This topic has been closed to new replies.

About this Topic