示例#1
0
function om_wpb_detect($post)
{
    global $_WPB_PAGE_SUPPORT_CUSTOM_ROW;
    $_WPB_PAGE_SUPPORT_CUSTOM_ROW = true;
    if (strcasecmp(substr(ltrim($post->post_content), 0, 7), '[vc_row') == 0) {
        om_body_add_class('om-wpb-active');
    } else {
        om_body_remove_class('om-wpb-active');
    }
}
示例#2
0
 function om_custom_sidebar_setup($post_id)
 {
     if ($post_id) {
         if (get_post_type($post_id) == 'portfolio' && is_single($post_id) || in_array(get_post_meta($post_id, '_wp_page_template', true), array('template-portfolio.php', 'template-100width.php', 'template-content-only-100width.php', 'template-sitemap.php'))) {
             $sidebar_type = 'hide';
         } else {
             $sidebar_type = get_post_meta($post_id, OM_THEME_SHORT_PREFIX . 'sidebar_show', true);
         }
         $sidebar_pos = get_post_meta($post_id, OM_THEME_SHORT_PREFIX . 'sidebar_custom_pos', true);
     } else {
         if (is_404() || is_search() || is_tax('portfolio-type')) {
             $sidebar_type = 'hide';
         } else {
             $sidebar_type = '';
         }
         $sidebar_pos = '';
     }
     if ($sidebar_type == 'hide') {
         om_body_add_class('sidebar-hidden');
     } else {
         om_body_add_class('sidebar-display');
     }
     if ($sidebar_pos == 'left') {
         om_body_add_class('flip-sidebar');
     } elseif ($sidebar_pos == 'right') {
         om_body_remove_class('flip-sidebar');
     }
 }