public static function render_position($position, $post_id = null) { global $post; $ordered_sections = array(); $post_id == null ? $post->ID : $post_id; foreach (Januas_Rendering::$januas_sections as $section) { if (get_post_meta($post_id, "januas_{$section}_visible", true) == 'y' && get_post_meta($post_id, "januas_{$section}_position", true) == $position) { $ordered_sections[] = array(get_post_meta($post_id, "januas_{$section}_order", true), $section); } } // custom if ($position == 'main') { if (get_post_meta($post_id, "januas_registration_visible", true) == 'y') { $ordered_sections[] = array(get_post_meta($post_id, "januas_registration_order", true), 'registration'); } } usort($ordered_sections, array('Januas_Rendering', 'sort_position_array')); foreach ($ordered_sections as $section) { Januas_Rendering::render_section($section[1], $post_id); } }
<div id="inner-content" class="wrap clearfix"> <div id="main" class="eightcol first clearfix" role="main"> <article id="post-<?php the_ID(); ?> " <?php post_class('clearfix'); ?> role="article"> <?php Januas_Rendering::render_section('description'); ?> <?php Januas_Rendering::render_position('main', get_the_ID()); ?> </article> <!-- end article --> <?php } ?> <?php } else { ?>
<div id="sidebar1" class="sidebar fourcol last clearfix" role="complementary"> <?php Januas_Rendering::render_position('sidebar', get_the_ID()); ?> </div>