user3691236
user3691236

Reputation: 11

Wordpress custom field parameter use

Want to use the parameter that I get over the Custom Field Option in Wordpress for an included site with searching results.

This is my code (without the parameter everything runs, but how can I use the parameter in the URL?):

<?php $parameter = get_post_meta($post->ID, 'searchingword', false); ?>
        <?php foreach($parameter as $parameter) {
            echo file_get_contents_curl('http://www.domain.com/searching.php?search=.$parameter.');         } ?>

Upvotes: 0

Views: 36

Answers (1)

Andy Tschiersch
Andy Tschiersch

Reputation: 3816

Your syntax is wrong. Try this:

echo file_get_contents_curl('http://www.domain.com/searching.php?search='. $parameter);

And in the foreach loop you have to use 2 different variables:

foreach($parameter as $param) {
    echo file_get_contents_curl('http://www.domain.com/searching.php?search='. $param);
    ...

Upvotes: 2

Related Questions