0
我正在尝试将woocommerce集成到非woocommerce主题。除了一个问题以外,情况很好。Woocommerce wordpress functions.php - 将div添加到div
我的主题有一个叫做块的div,它隐藏内容然后淡入/添加填充。我希望这也是在woocommerce页面中。
DIV的是这样的
<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>
使用这种http://docs.woothemes.com/document/third-party-custom-theme-compatibility/
我试图把这个在我的功能PHP和我得到的是一个白色的页面,很多语法错误的
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>';
}