• Resolved suldan

    (@suldan)


    hello,
    I want to use wp for a podcasting site. I’m using the wp audio player and embed the audio file through the [audio:…]-syntax. This creates a enclosure with the mp3-file. So far so good.

    I’m also displaying my custom fields in the head of the post. There I put stuff like duration or source…etc. Now wp also displays the enclosure in the custom fields, like this: enclosure: https://path_to_file 17662651 audio/mpeg.

    I want to keep the audio enclosure (its a podcast ;O) and I want to keep my custom fields in the head of the post, but I need to prevent the enclosure being displayed. Any idea?

    Here a temporary link to the podcastsite

    greatings
    suldan

Viewing 5 replies - 1 through 5 (of 5 total)
  • Used this some time ago, but should work:

    <?php
    //exclude the "_*" custom fields and "enclosure" when displaying in loop
    if ( $keys = get_post_custom_keys() ) {
    echo "<ul class='post-meta'>\n";
    foreach ( (array) $keys as $key ) {
    $keyt = trim($key);
    if ( '_' == $keyt{0} || 'enclosure' == $keyt )
    continue;
    $values = array_map('trim', get_post_custom_values($key));
    $value = implode($values,', ');
    echo apply_filters('the_meta_key', "
    <li><span class='post-meta-key'>$key:</span> $value</li>
    \n", $key, $value);
    }
    echo "\n";
    }
    ?>
    Thread Starter suldan

    (@suldan)

    Wow – ty vm Michael

    its perfect :O)

    Thread Starter suldan

    (@suldan)

    you just forgot to close the ul :o)

    <?php
    //exclude the "_*" custom fields and "enclosure" when displaying in loop
    if ( $keys = get_post_custom_keys() ) {
    echo "<ul class='post-meta'>\n";
    foreach ( (array) $keys as $key ) {
    $keyt = trim($key);
    if ( '_' == $keyt{0} || 'enclosure' == $keyt )
    continue;
    $values = array_map('trim', get_post_custom_values($key));
    $value = implode($values,', ');
    echo apply_filters('the_meta_key', "
    <li><span class='post-meta-key'>$key:</span> $value</li>
    \n", $key, $value);
    }
    echo "</ul>\n";
    }
    ?>

    Thanks for the fix suldan.

    Halla.
    Seems I do have the same problem. I’m using audio player plugin. WordPress creates a enclosure for the .mp3 file that I’m hosting on my domain.
    The MAIN problem is that everyone who is subscribed to my feed will receive in mail, at the end, something like: ” This posting includes an audio/video/photo media file: Download Now ” . Under Download Now it’s my link and that’s not good at all ! I don’t want to experience legallity issues with artists/labels.
    So all I want is to remove that line from Feeds… thing that might be possible if the enclosure is removed.
    Now I can see that code above.. where should I post it.. what should I do in order to have it workin’ ?

    I’m waiting for an answer asap.
    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘don’t want enclosure to display in custom fields’ is closed to new replies.