responsive_II_layout_meta_box

Define Layout Meta Box.

Description

responsive_II_layout_meta_box(); 

Define the markup for the meta box for the layout post custom meta data. The metabox will consist of radio selection options for default and each defined, valid layout option for single blog posts or static pages, depending on the context.


Usage

  1. if ( !function_exists( 'responsive_II_layout_meta_box' ) ) { 
  2. require_once '/includes/functions-layout.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = responsive_II_layout_meta_box(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/functions-layout.php  
  1. function responsive_II_layout_meta_box() { 
  2. global $post; 
  3. $custom = ( get_post_custom( $post->ID ) ? get_post_custom( $post->ID ) : false ); 
  4. $layout = ( isset( $custom['_responsive_II_layout'][0] ) ? $custom['_responsive_II_layout'][0] : 'default' ); 
  5. $valid_layouts = responsive_II_valid_layouts(); 
  6. ?> 
  7. <p> 
  8. <select name="_responsive_II_layout"> 
  9. <?php foreach( $valid_layouts as $slug => $name ) { ?> 
  10. <?php $selected = selected( $layout, $slug, false ); ?> 
  11. <option value="<?php echo $slug; ?>" <?php echo $selected; ?>><?php echo $name; ?></option> 
  12. <?php } ?> 
  13. </select> 
  14. </p> 
  15. <?php