从某人那里得到了一个代码....
我喜欢的是将滑动div从右滑动到左边,我的意思是它将div隐藏到右边并慢慢向左滑动300px宽度.
HTML
<a id="loginPanel">quote</a>
<div id="userNav">User Area</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#loginPanel {
color: #000;
cursor:pointer;
}
#userNav {
width: 200px;
height: 200px;
display: none;
background: #ff0000;
}
Run Code Online (Sandbox Code Playgroud)
jQuery的
// Open / Close Panel According to Cookie //
if ($.cookie('panel') == 'open'){
$('#userNav').slideDown('fast');
} else {
$('#userNav').slideUp('fast');
}
// Toggle Panel and Set Cookie //
$('#loginPanel').click(function(){
$('#userNav').slideToggle('fast', function(){
if ($(this).is(':hidden')) {
$.cookie('panel', 'closed');
} else {
$.cookie('panel', 'open');
}
});
});
Run Code Online (Sandbox Code Playgroud)
请在这个上需要帮助.只是让div从右向左滑动
在woocommerce中,我使用以下代码在管理产品编辑页面上显示输入文本字段,这使我可以向该产品添加附加定价选项:
add_action( 'woocommerce_product_options_pricing', 'wc_cost_product_field' );
function wc_cost_product_field() {
woocommerce_wp_text_input( array( 'id' => 'repair_price', 'class' => 'wc_input_price short', 'label' => __( 'Repair Cost', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')' ) );
}
add_action( 'save_post', 'wc_cost_save_product' );
function wc_cost_save_product( $product_id ) {
// stop the quick edit interferring as this will stop it saving properly, when a user uses quick edit feature
if (wp_verify_nonce($_POST['_inline_edit'], 'inlineeditnonce'))
return;
// If this is a auto save do nothing, we only save when …
Run Code Online (Sandbox Code Playgroud) 我真的很想在这里寻求帮助,从昨天开始就一直在尝试这样做,但仍然没有运气,所以这就是我想要实现的目标
收藏= 自定义帖子类型
材料= 分配给“集合”的自定义分类法
正文= 分配给“集合”的自定义分类法
颜色= 分配给“集合”的自定义分类法
结构将是这样的
- Material
- Mat1
- Mat2
- Body
- Body1
- Body2
- Color
- Color1
- Color2
Run Code Online (Sandbox Code Playgroud)
我得到了这个代码,但它根本不起作用
$post_type = 'collection';
$taxonomies = get_object_taxonomies( (object) array( 'post_type' => $post_type, 'hide_empty' => true ) );
foreach( $taxonomies as $taxonomy ){
echo $taxonomy->name;
$terms = get_terms( …
Run Code Online (Sandbox Code Playgroud) 我真的需要一些帮助,我的问题是我无法使用ACF显示来自组字段的标签
下面的脚本显示名称和值,我需要显示"标签"及其"值",我找不到任何东西.
if( have_rows('product_specifications') ):
while( have_rows('product_specifications') ): the_row();
$subfields = get_field('product_specifications');
if( $subfields ) { ?>
<ul>
<?php
foreach ($subfields as $spec => $value) {
if ( !empty($value) ) { ?>
<li><?php echo $spec; ?> : <?php echo $value; ?></li>
<?php }
} ?>
</ul>
<?php }
endwhile;
endif;
Run Code Online (Sandbox Code Playgroud)
这是我目前的输出:
lamp_type : E27
wattage : 1x 60W Max
globe_included : 1
colour_cord : Clear
Run Code Online (Sandbox Code Playgroud)
它应该是:
Lamp Type : E27
Wattage : 1x 60W Max
Globe : 1
Colour Cord …
Run Code Online (Sandbox Code Playgroud) 我正在使用自定义帖子类型并在其上集成 woocommerce,我可以在页面上添加“添加到购物车”按钮并将其添加到购物车,所以它工作正常
这是我的代码
class WCCPT_Product_Data_Store_CPT extends WC_Product_Data_Store_CPT {
/**
* Method to read a product from the database.
* @param WC_Product
*/
public function read( &$product ) {
$product->set_defaults();
if ( ! $product->get_id() || ! ( $post_object = get_post( $product->get_id() ) ) || ! in_array( $post_object->post_type, array( 'products', 'product' ) ) ) { // change birds with your post type
throw new Exception( __( 'Invalid product.', 'woocommerce' ) );
}
$id = $product->get_id();
$product->set_props( array(
'name' => $post_object->post_title,
'slug' => …
Run Code Online (Sandbox Code Playgroud) 需要一些帮助,我需要在标签交替打开时关闭div,或者一个标签可以打开而其他标签会自动关闭
这是我从别人那里得到的小提琴
HTML:
<div class="siteMap">
<div class="mapButton"></div>
<div class="theMap" style="background:red;">content here</div>
</div>
<div class="siteMap" style="margin-top:70px;">
<div class="mapButton"></div>
<div class="theMap" style="background:blue;">content here</div>
</div>
Run Code Online (Sandbox Code Playgroud)
$('.mapButton').click(function() {
var mapPos = parseInt($(this).parent('.siteMap').css('left'), 10);
if (mapPos < 0) {
$(this).parent('.siteMap').animate({
left: '+=200'
}, 458, 'swing', function() {
// Animation complete.
});
}
else {
$(this).parent('.siteMap').animate({
left: '-=200'
}, 458, 'swing', function() {
// Animation complete.
});
}
});
Run Code Online (Sandbox Code Playgroud)
.siteMap {
width:200px;
position:fixed;
left:-200px;
top:0px;
display:block;
color:#FFF;
z-index:2;
opacity: 0.95;
}
.siteMap .mapButton …
Run Code Online (Sandbox Code Playgroud)