• Resolved hallm

    (@hallm)


    I’m trying to used the custom fields area to allow me to save a word or phrase that can be passed to a script that I’ve purchased to display amazon results. For example I would put Books for the key and Recipe Books for the value and I would like to be able to pass those two variables to my script. How can I pull those values out? I looked at the documentation but I’m not seeing what I’m looking for.

Viewing 2 replies - 1 through 2 (of 2 total)
  • In the index.php file of whatever theme you’re using:


    $value = get_post_meta($post->id, 'books', true);
    if ($value == 'recipe books'):
    // do whatever you wish for a post where key = 'books' and value = 'recipe books'
    endif;

    Thread Starter hallm

    (@hallm)

    Thank you, that’s exactly what I was looking for.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to use customer fields’ is closed to new replies.