Skip to content

Instantly share code, notes, and snippets.

@armandmorin
armandmorin / testimonial-meta.php
Created September 1, 2011 08:38
Metabox Outside of Group
<?php
/**
* NOTE: The radio buttons which determine a css style in my program are CURRENTLY inside the group.
* I am trying to do this OUTSIDE of the group. If I leave it inside the group, I have to define the settings for each testimonial I have. I want to set it once and
* have it define each instance.
*
*/
?>
<div class="mcms_optinpage">
<?php
global $testimonial_metabox;
while( $testimonial_metabox->have_fields( 'testimonials' ) )
{
echo '<div class="';
echo $testimonial_metabox->the_field('background');
echo $testimonial_metabox->the_value();
echo '">';
echo wpautop($testimonial_metabox->get_the_value('content'));
@armandmorin
armandmorin / javscript addition
Created September 3, 2011 05:57
Multiple Metabox Fix
<script type="text/javascript">
//<![CDATA[
jQuery('body').bind('afterPreWpautop', function(e, o){
o.data = o.unfiltered
.replace(/caption\]\[caption/g, 'caption] [caption')
.replace(/<object[\s\S]+?<\/object>/g, function(a) {
return a.replace(/[\r\n]+/g, ' ');
});
}).bind('afterWpautop', function(e, o){
@armandmorin
armandmorin / gist:1258146
Created October 3, 2011 00:07
WPAlchemy sample select box
<?php $mb->the_field('font_weight'); ?>
<select name="<?php $mb->the_name(); ?>">
<option value="normal"<?php $mb->the_select_state('normal'); ?>>Normal</option>
<option value="italic"<?php $mb->the_select_state('italic'); ?>>Italic</option>
<option value="bold"<?php $mb->the_select_state('bold'); ?>>Bold</option>
<option value="bolditalic"<?php $mb->the_select_state('bolditalic'); ?>>Bold Italic</option>
</select>