Metabox Slider Implementation
-
Hi, I’m using the OT metaboxes for my custom post-type…
this is the code of my metaboxes (just 2)
$my_meta_box = array( 'id' => 'port_meta_box', 'title' => 'Otras Opciones', 'desc' => '', 'pages' => array( 'portfolio' ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'id' => 'port_imgs', 'label' => 'Imágenes', 'desc' => 'Imágenes del Proyecto, agregue las imágenes para el slideshow de su proyecto', 'std' => '', 'type' => 'slider', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step'=> '', 'class' => '' ), array( 'id' => 'port_url', 'label' => 'Link del Proyecto', 'desc' => 'Agregue un link para su proyecto. (incluya https:// )', 'std' => '', 'type' => 'text', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'min_max_step'=> '', 'class' => '' ) ) );
ok for the text box i only render this in my theme by this code:
<?php $meta = get_post_meta( get_the_ID(), 'port_url', TRUE ); echo $meta; ?>
It’s fine for me but… Now i have a problem rendering the Slider… this is an exaple code of implementation…
<?php if ( function_exists( 'ot_get_option' ) ) { /* get the slider array */ $slides = ot_get_option( 'port_imgs', array() ); if ( ! empty( $slides ) ) { foreach( $slides as $slide ) { echo ' <li> <img src="' . $slide['image'] . '" alt="' . $slide['title'] . '" /> </li>'; } } } ?>
Please help, it’s a fantastic way for implement custom boxes for the theme and for the posts but it’s a little confused for me the implementation of the metaboxes.
Tnks a lot.
Regards
- The topic ‘Metabox Slider Implementation’ is closed to new replies.