コード例 #1
0
 /** 
  *  Show meta content
  */
 public function filter_show_meta_content($post_content)
 {
     global $post;
     $meta_code = '';
     $meta_content = get_post_meta($post->ID, $this->meta_name, TRUE);
     if (strlen($meta_content)) {
         $rows = json_decode($meta_content);
         $is_content_sidebars_content = otw_is_content_sidebars_content();
         if ($rSize = count($rows)) {
             if (!$is_content_sidebars_content) {
                 $meta_code .= " <div class=\"otw-row\">";
             }
             foreach ($rows as $row) {
                 if ($cSize = count($row->columns)) {
                     $meta_code .= "<div class=\"otw-row\">";
                     $cCount = 1;
                     foreach ($row->columns as $column) {
                         $is_last = '';
                         if ($cCount == $cSize) {
                             $is_last = ' last="1"';
                         }
                         $column_class = $this->number_names[$this->grid_size / $column->from_rows * $column->rows];
                         $meta_code .= '[otw_shortcode_grid_column rows="' . $column->rows . '" from_rows="' . $column->from_rows . '" mobile_rows="' . $column->mobile_rows . '" mobile_from_rows="' . $column->mobile_from_rows . '"' . $is_last . ']';
                         if (count($column->shortcodes)) {
                             foreach ($column->shortcodes as $shortcode) {
                                 $meta_code .= $shortcode->shortcode_code;
                             }
                         }
                         $meta_code .= '[/otw_shortcode_grid_column]';
                         $cCount++;
                     }
                     $meta_code .= "</div>";
                 }
             }
             if (!$is_content_sidebars_content) {
                 $meta_code .= "</div>";
             }
         }
     }
     return $post_content . ' ' . $this->otw_shortcode_remove_wpautop($meta_code);
 }
コード例 #2
0
ファイル: otw_functions.php プロジェクト: phupx/genco
 function otw_post_content_wrapper($the_content)
 {
     if (otw_is_content_sidebars_content()) {
         $the_content = '<div class="otw-row"><div class="otw-row"><div class="otw-twentyfour otw-columns">' . $the_content . '</div></div></div>';
     }
     return $the_content;
 }