WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. syncbox
    Member
    Posted 4 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:

    <?php
    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
    Member
    Posted 4 years ago #

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

  3. syncbox
    Member
    Posted 4 years ago #

    Got this working....

    <?php
     $lastposts = get_posts('numberposts=300&child_of=323&post_type=page&post_parent=323&orderby=rand');
     foreach($lastposts as $post) :
        setup_postdata($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