WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7 Dynamic Text Extension
Retrieve custom fields from the page based on id? (1 post)

  1. allwork
    Member
    Posted 3 years ago #

    Is it possible to retrieve custom field value from other page than the current page?

    In example in situation like this:

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
      $pages = get_pages('child_of=100&sort_column=menu_order');
        foreach ($pages as $page) {
          $code = get_post_meta($page->ID, 'productCode', true);
          echo do_shortcode('[contact-form 1 "sendthiscode"]');
          }

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic