Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick code fix for Locke
<div class="my_meta_control">
<a style="float:right; margin:0 10px;" href="#" class="dodelete-docs button">Remove All</a>
<p>Add Product Guide</p>
<?php while($mb->have_fields_and_multi('_nb_docs')): ?>
<?php $mb->the_group_open(); ?>
<?php $mb->the_field('_nb_title'); ?>
<label>Name of the Product</label>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>"/></p>
<?php $mb->the_field('_nb_kind'); ?>
<label>Kind</label>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>"/></p>
<?php $mb->the_field('_nb_weight'); ?>
<label>Weight</label>
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>"/></p>
<?php $mb->the_field('_nb_beneficios'); ?>
<label>Beneficios</label>
<textarea name="<?php $mb->the_name(); ?>" rows="5"><?php $mb->the_value(); ?></textarea>
<p style="margin-bottom:15px; padding-top:5px;"><a href="#" class="dodelete button">Remove Product</a></p>
<?php $mb->the_group_close(); ?>
<?php endwhile; ?>
<p style="margin-bottom:15px; padding-top:5px;"><a href="#" class="docopy-docs button">Add Product</a></p>
</div>
<?php
//$wpalchemy_media_access = new WPAlchemy_MediaAccess();
$custom_mb = $simple_mb = new WPAlchemy_MetaBox(array
(
'id' => '_product_guide',
'title' => 'Product Guide',
'template' => get_stylesheet_directory() . '/functions/includes/metaboxes/simple-meta.php',
'mode' => WPALCHEMY_MODE_EXTRACT,
'prefix' => '_nb_'
));
/* eof */
<?php get_header(); ?>
<div class="breadcrumb"></div>
<div class="inner">
<div class="innerWrap">
<menu class="navmenu">
<ul>
<li><a href="#" rel="0">Descripción</a></li>
<li><a href="#" rel="1">Guia del Producto</a></li>
<li><a href="#" rel="2">Galeria</a></li>
</ul>
</menu>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
global $simple_mb;
$meta = $simple_mb->the_meta();
// this is a dump of all the meta data
var_dump( $meta );
?>
<h2><?php the_title(); ?></h2>
<ul id="products" class="products">
<li class="slide-01">
<div class="fl img">
<?php the_post_thumbnail('large'); ?>
</div>
<div class="fr txt">
<?php the_content(); ?>
</div>
</li>
<li class="slide-02">
<div class="fl img">
<div class="fr txt">
<?php
// this is an array because its a repeating field group
$group = $simple_mb->the_value('_nb_docs');
// once you get it you have to loop it
foreach ( $group as $item )
{
echo $item['_nb_title'];
echo $item['_nb_kind'];
echo $item['_nb_weight'];
echo $item['_nb_beneficios'];
}
?>
</div>
</li>
<li class="slide-03">
prod
<?php //the_gallery(); ?>
</li>
</ul>
<?php endwhile; endif; ?>
</div>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment