woocommerce를 비 woocommerce 테마에 통합하려고합니다. 하나의 문제를 제외하고는 괜찮습니다.Woocommerce wordpress functions.php - div에 PHP 추가
내 테마에는 콘텐츠를 숨기고 패딩을 추가하는 block이라는 div가 있습니다. 나는 이것도 woocommerce 페이지에 있기를 원한다.
사업부는 내 함수 PHP에이를 넣어 노력이 http://docs.woothemes.com/document/third-party-custom-theme-compatibility/
사용이
<div id="block" <?php
if ($detect->isMobile()) {if($detect->isTablet()){
/* Tab */
if (get_field("search_override_header_position", "options") && get_field("search_tablet_header_position", "options")) {echo 'data-header-position="'.get_field("search_tablet_header_position", "options").'"';} else {echo 'data-header-position="'.$tablet_header_position.'"';};
} else {
/* Mob */ }
if (get_field("search_override_header_position", "options") && get_field("search_mobile_header_position", "options")) {echo 'data-header-position="'.get_field("search_mobile_header_position", "options").'"';} else {echo 'data-header-position="'.$mobile_header_position.'"';};
} else {
/* Desc */
if (get_field("search_override_header_position", "options") && get_field("search_header_position", "options")) {echo 'data-header-position="'.get_field("search_header_position", "options").'"';} else {echo 'data-header-position="'.$header_position.'"';};
}
?>> </div>
처럼 내가 얻을 수있는 모든 구문 오류의 흰색 페이지와 많이입니다
remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);
'
function my_theme_wrapper_start() {
echo '
<div id="block" <?php
if ($detect->isMobile()) {if($detect->isTablet()){
/* Tab */
if (get_field("search_override_header_position", "options") && get_field("search_tablet_header_position", "options")) {echo 'data-header-position="'.get_field("search_tablet_header_position", "options").'"';} else {echo 'data-header-position="'.$tablet_header_position.'"';};
} else {
/* Mob */ }
if (get_field("search_override_header_position", "options") && get_field("search_mobile_header_position", "options")) {echo 'data-header-position="'.get_field("search_mobile_header_position", "options").'"';} else {echo 'data-header-position="'.$mobile_header_position.'"';};
} else {
/* Desc */
if (get_field("search_override_header_position", "options") && get_field("search_header_position", "options")) {echo 'data-header-position="'.get_field("search_header_position", "options").'"';} else {echo 'data-header-position="'.$header_position.'"';};
}
?>> </div><section id="main">';
}
function my_theme_wrapper_end() {
echo '</section>';
}