日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php将多个页面写在一个页面,php – 将多个标签添加到WooCommerce单个产品页面

發布時間:2025/5/22 php 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php将多个页面写在一个页面,php – 将多个标签添加到WooCommerce单个产品页面 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我想為WooCommerce添加三個自定義標簽.我有下面的代碼,其中兩個顯示,但由于某種原因,屬性描述選項卡不顯示在頁面上.不僅數量定價選項卡不顯示其描述.我試圖將代碼的不同部分移動到不同的位置,我已檢查代碼是否有錯誤或缺少部分.這是我能得到的盡可能接近.

我的過程基本上是刪除我不想要的現有標簽,然后按照我希望它們出現的順序添加新標簽.

我有一種感覺,我錯過了一些東西.

這是我正在使用的代碼:

// WooCommerce Tabs

// REMOVE EXISTING TABS

add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

function woo_remove_product_tabs( $tabs ) {

unset( $tabs['description'] ); // Remove the description tab

// unset( $tabs['reviews'] ); // Remove the reviews tab

unset( $tabs['additional_information'] ); // Remove the additional information tab

return $tabs;

}

// ADD ATTRIBUTE DESCRIPTION TAB

add_filter( 'woocommerce_product_tabs', 'woo_attrib_desc_tab' );

function woo_attrib_desc_tab( $tabs ) {

// Adds the Attribute Description tab

$tabs['attrib_desc_tab'] = array(

'title' => __( 'Desc', 'woocommerce' ),

'priority' => 100,

'callback' => 'woo_attrib_desc_tab_content'

);

return $tabs;

}

// ADD QUANTITY PRICING TAB

add_filter( 'woocommerce_product_tabs', 'woo_qty_pricing_tab' );

function woo_qty_pricing_tab( $tabs ) {

// Adds the qty pricing tab

$tabs['qty_pricing_tab'] = array(

'title' => __( 'Quantity Pricing', 'woocommerce' ),

'priority' => 110,

'callback' => 'woo_qty_pricing_tab_content'

);

return $tabs;

}

// ADD OTHER PRODUCTS TAB

add_filter( 'woocommerce_product_tabs', 'woo_other_products_tab' );

function woo_other_products_tab( $tabs ) {

// Adds the other products tab

$tabs['other_products_tab'] = array(

'title' => __( 'Other Products', 'woocommerce' ),

'priority' => 120,

'callback' => 'woo_other_products_tab_content'

);

return $tabs;

}

// ADD CUSTOM TAB DESCRIPTIONS

function woo_attrib_desc_tab_content() {

// The attribute description tab content

echo '

Description

';

echo '

Custom description tab.

';

}

function woo_qty_pricing_tab_content() {

// The qty pricing tab content

echo '

Quantity Pricing

';

echo '

Here\'s your quantity pricing tab.

';

}

function woo_other_products_tab_content() {

// The other products tab content

echo '

Other Products

';

echo '

Here\'s your other products tab.

';

}

編輯下面LoicTheAztec的回復,這是我的整個functions.php文件.我試過它有沒有?>在底部:

add_theme_support( 'builder-3.0' );

add_theme_support( 'builder-responsive' );

function register_my_fonts() {

wp_register_style('googleFonts-OpenSans', '//fonts.googleapis.com/css?family=Open+Sans:400,300,700');

wp_enqueue_style( 'googleFonts-OpenSans');

}

add_action('wp_enqueue_scripts', 'register_my_fonts');

function sc_replacecolon( $content ){ return str_replace( '[sc:', '[sc name=', $content ); }

add_filter( 'the_content', 'sc_replacecolon', 5 );

/* WOOCOMMERCE */

add_filter( 'woocommerce_product_tabs', 'woo_custom_product_tabs', 100, 1 );

function woo_custom_product_tabs( $tabs ) {

// 1) Removing tabs

unset( $tabs['description'] ); // Remove the description tab

// unset( $tabs['reviews'] ); // Remove the reviews tab

unset( $tabs['additional_information'] ); // Remove the additional information tab

// 2 Adding new tabs

//Attribute Description tab

$tabs['attrib_desc_tab'] = array(

'title' => __( 'Desc', 'woocommerce' ),

'priority' => 100,

'callback' => 'woo_attrib_desc_tab_content'

);

// Adds the qty pricing tab

$tabs['qty_pricing_tab'] = array(

'title' => __( 'Quantity Pricing', 'woocommerce' ),

'priority' => 110,

'callback' => 'woo_qty_pricing_tab_content'

);

// Adds the other products tab

$tabs['other_products_tab'] = array(

'title' => __( 'Other Products', 'woocommerce' ),

'priority' => 120,

'callback' => 'woo_other_products_tab_content'

);

return $tabs;

}

// New Tab contents

function woo_attrib_desc_tab_content() {

// The attribute description tab content

echo '

Description

';

echo '

Custom description tab.

';

}

function woo_qty_pricing_tab_content() {

// The qty pricing tab content

echo '

Quantity Pricing

';

echo '

Here\'s your quantity pricing tab.

';

}

function woo_other_products_tab_content() {

// The other products tab content

echo '

Other Products

';

echo '

Here\'s your other products tab.

';

}

?>

總結

以上是生活随笔為你收集整理的php将多个页面写在一个页面,php – 将多个标签添加到WooCommerce单个产品页面的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: free欧美性69护士呻吟 | 精品少妇一区二区 | 欧美成人免费看 | 毛片网页 | 性色av一区二区三区四区 | 亚洲第一色网站 | 精品少妇人妻av一区二区三区 | 丁香午夜| 手机看片日韩 | 国产在线视频二区 | 成人免费午夜 | 欧美在线不卡视频 | 色眯眯av| 亚洲精品字幕 | 狠狠艹av | 久久天天躁狠狠躁夜夜av | 尹人成人网 | 欧美视频第一区 | 久久99精品国产91久久来源 | 97在线免费观看视频 | 在线不欧美 | 国产精品vip | 夜夜撸影院 | 日韩精品免费在线 | 88xx成人永久免费观看 | 亚洲影院中文字幕 | 91在线视频免费播放 | 久射网 | 欧美色炮| 在线精品视频免费观看 | 一级α片免费看刺激高潮视频 | 一级片网址 | 国产三级久久久久 | 99er这里只有精品 | 超碰xxx | 91禁动漫在线 | 粉嫩一区二区三区 | 吃瓜网今日吃瓜 热门大瓜 色婷在线 | 欧美日韩一区二区三区在线观看 | 亚洲欧美日韩精品永久在线 | 日美一级片 | 一区二区av在线 | 黄色网页在线 | 久久久久久久久影院 | 清纯唯美亚洲综合 | 一本毛片 | 超碰97久久 | 日韩免费在线观看视频 | 亚洲夜夜爽 | 亚洲毛片视频 | 99精品视频播放 | 亚洲精品日韩丝袜精品 | 亚洲激情自拍 | 久操视频免费观看 | 91精品久久久久久久久久久 | 99re6在线观看 | 日韩精品中文字幕一区二区三区 | 久久精品无码Av中文字幕 | 黄色小视频在线看 | 北条麻妃久久精品 | 天天躁日日躁狠狠躁av麻豆男男 | 在线免费观看麻豆 | 五月天激情啪啪 | 韩日激情视频 | 一区二区三区网 | 国产一级淫片a视频免费观看 | 在线观看中文字幕 | 超碰碰97 | 国产不卡在线播放 | 在线免费观看毛片 | 亚洲精品成 | 国产精品久久久久久久久晋中 | 欧美69久成人做爰视频 | 一区二区三区四区视频在线观看 | 亚洲欧美午夜 | 国产福利一区在线 | 亚洲精品国产精品乱码不99 | 精品国产18久久久久久二百 | 国产良妇出轨视频在线观看 | 黄色成人小视频 | 日日摸天天爽天天爽视频 | 成人免费做受小说 | 国产亚洲精品久久久久四川人 | 在线视频播放大全 | 日韩一区二区三区精品视频 | 亚洲综合大片69999 | 黄色大片aaa| 国产三级漂亮女教师 | 黄色片日韩| 亚洲综合伊人久久 | 无遮挡的裸体按摩的视频 | 亚洲加勒比 | 免费黄色av网站 | 亚洲乱码国产一区三区 | av一二三| 奇米四色影视 | 女性女同性aⅴ免费观女性恋 | 日韩成人av在线播放 | 男人的天堂黄色 |