5 reputation
16
bio website
location
age 26
visits member for 1 year, 10 months
seen Oct 11 '13 at 15:55

Junior Developer www.purpleclaw.co.uk


Sep
27
accepted Displaying information from custom field on custom post type
Sep
27
awarded  Commentator
Sep
27
comment Displaying information from custom field on custom post type
I have added the full function for you (:
Sep
27
revised Displaying information from custom field on custom post type
Below is the full function that creates the meta box & stores the information:
Sep
27
awarded  Editor
Sep
27
revised Displaying information from custom field on custom post type
I have added the code that stores the custom field values
Sep
27
comment Displaying information from custom field on custom post type
Oops sorry @cybnet will bear this in mind for future. I have added the function that stores the custom fields value into my question.
Sep
27
comment Displaying information from custom field on custom post type
@anjum this is a custom taxonomy (i think) here is the code that generates the custom post type and the category: ` // V Custom Post Type add_action( 'init', 'create_videos' ); function create_videos() { register_post_type( 'videos', array( 'labels' => array( 'name' => __( 'Videos' ), 'singular_name' => __( 'Video' ) ), 'public' => true, 'taxonomies' => array("category"), 'has_archive' => true, 'supports' => array( 'title', 'editor', 'thumbnail' ), ) ); }`
Sep
27
comment Displaying information from custom field on custom post type
Thanks @cybnet I tried your suggestion but I still have an issue where every single video I add is displayed - wordopress is ignoring the fact that I want commercial videos posted with the commercial category and music videos posted with the music category. My loop is incorrect because it is not working the way I want it to.
Sep
27
asked Displaying information from custom field on custom post type
Sep
25
comment How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
Im viewing it in single-videos.php: <div class="page-content"> <?php global $post; if (get_post_meta($post->ID, 'my_video_type', true) == "youtube") { echo do_shortcode('[youtube id="'.get_post_meta($post->ID, 'my_meta_box_text', true).'"]'); } if (get_post_meta($post->ID, 'my_video_type', true) == "vimeo") { echo do_shortcode('[vimeo id="'.get_post_meta($post->ID, 'my_meta_box_text', true).'"]'); } ?> </div>
Sep
25
comment How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
Still not displaying any videos :(
Sep
25
comment How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
I cannot add the videos id in the shortcode because this will not always be the same it will be different each time Video Short code :function wp_youtube_video($atts) { extract(shortcode_atts(array( 'id' => '' ), $atts)); return '<iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/'.$atts['id'].'" frameborder="0" allowFullScreen></iframe>'; } add_shortcode('youtube', 'wp_youtube_video');
Sep
25
comment How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
I dont want it to return the video id I want it to display the video in the front end when the user enters the id in the meta box. I want wordpress to display the video once the id has been entered.
Sep
25
comment How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?
Thanks. I do have a custom post type called videos which is why I placed that there. I have added the code you suggested to save the the video type but for some reason it wont display the video on the front end :(
Sep
25
asked How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?