Give help. Get help.

  • # July 3, 2013 at 1:24 am

    I posted a [discussion]( “”) the other day.
    Explaining that my Videos were not displaying on my Video page from my custom post type that I created using [this tutorial.]( “”)
    I thought I fixed the issue but it turns out the issue *wasn’t resolved.*

    Anyway, so I thought maybe the way I setup my CPT/Fields were messing things up.
    So I found another tutorial and redid the CPT and Fields, here is the new code//
    []( “”)

    I was able to get my Video ID field to save, but when I select “Youtube” or “Vimeo”, then save, it just goes back to it’s default option “Select”.

    I am new to all of this WordPress PHP so I have no idea if the select menu code is correct…
    I’d appreciate any help to find the cause of this.

    # July 3, 2013 at 12:30 pm

    Please Help >.<

    # July 3, 2013 at 1:00 pm

    your problem might be this line

    if( $post->post_type == ‘revision’ ) return; // Don’t store custom data twice

    since you have already saved your post the second time is a revision so it just returns not updating the post meta.
    try commenting the whole line and if it works either make sure with javascript that every field is required or remove it all together

    # July 3, 2013 at 1:10 pm

    @pixelgrid I commented out the line, but the Selected Value is still not saving :(

    foreach ($videos_meta as $key => $value) { // Cycle through the $videos_meta array!
    //if( $post->post_type == 'revision' ) return; // Don't store custom data twice
    $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)
    if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value
    update_post_meta($post->ID, $key, $value);
    } else { // If the custom field doesn't have a value
    add_post_meta($post->ID, $key, $value);
    if(!$value) delete_post_meta($post->ID, $key); // Delete if blank

    # July 3, 2013 at 1:23 pm

    @pixelgrid The funny thing is that I’m using the same type of select menu from my events Post type, and that saves perfectly…
    But it just doesn’t want to work in my video’s post type :/

    # July 3, 2013 at 5:26 pm

    Anyone good with PHP mind taking a look at this for me Please?

    # July 3, 2013 at 6:30 pm

    you might find it better asking your question to .
    that forum is only for wordpress questions.
    you might find help quicker than here.

    # July 3, 2013 at 8:39 pm

    @pixelgrid Thank you

    # July 3, 2013 at 11:20 pm

    I was able to get assistance from someone via WordPress Stack Exchange :D

    You can check out the solution to the two issues here//
    []( “”)

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.