• Resolved arcab4

    (@arcab4)


    Hi guys and gals,

    so i’m stuck and need some help. I want to use a custom field to pass the value of it into an xml array.

    example:

    here’s the custom field snippet i normally use to make it show up on wordpress.

    <?php echo get_post_meta($post->ID, "customfieldA",true); ?>

    and then here’s the xml i want it to be passed into.

    $categories[] = array( 'name' => 'DVD Player',
                             'search_options' => array( 'keywords' => 'cheap dvd player' ) );

    So i want to replace “cheap dvd player” with my custom field “customfieldA”.

    some other notes:
    i have the XML code on my post template page. So i want to when adding/edting posts, to just insert a keyword into the custom field for that particular post.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • So i want to replace “cheap dvd player” with my custom field “customfieldA”.

    <?php
     $custom =  get_post_meta($post->ID, "customfieldA",true);
     $categories[] = array( 'name' => 'DVD Player',
          'search_options' => array( 'keywords' => $custom ) );
    ?>
    Thread Starter arcab4

    (@arcab4)

    Hey Reuben,

    Thanks man. that worked perfectly. appreciate your help. saved me hours of searching. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pass Custom Field Into XML Array? Possible?’ is closed to new replies.