小编use*_*208的帖子

在woocommerce电子邮件中调用自定义订单元

我在woocommerce结帐时有自定义字段,我希望这些字段显示在电子邮件模板中.

我添加以下内容但仍未显示:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post();

            $mycustom = get_post_meta( $order->id, 'wccf_delivery_day', true );
            echo $mycustom;?>
            <?php endwhile; ?>
Run Code Online (Sandbox Code Playgroud)

php wordpress woocommerce

5
推荐指数
1
解决办法
6317
查看次数

在 WordPress 中显示随机分类术语

我正在尝试在 WordPress 中显示随机分类术语,根据其标题按字母顺序排列。

我使用以下代码,它随机显示类别,但不按字母顺序显示。

<?php
//display random sorted list of terms in a given taxonomy
$counter = 0;
$max = 5; //number of categories to display
$taxonomy = 'cp_recipe_category';
$terms = get_terms($taxonomy, 'orderby=name&order= ASC&hide_empty=0');
shuffle ($terms);
//echo 'shuffled';
if ($terms) {
foreach($terms as $term) {
    $counter++;
    if ($counter <= $max) {
    echo '<p><a href="' .get_term_link( $term, $taxonomy ) . '" title="' .  sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a></p> '; …
Run Code Online (Sandbox Code Playgroud)

php wordpress

2
推荐指数
1
解决办法
3483
查看次数

延迟jQuery中的点击功能

我有一个单击功能,当单击链接时,会向下滚动到附加的div。如何在实际向下滚动之前附加大约5秒的延迟?

我试图将.delay()添加到函数中,但它似乎不起作用

$(".o-c").click(function() {
  $('html, body').animate({
    scrollTop: $(".one").offset().top
  }, 2000);
});
Run Code Online (Sandbox Code Playgroud)
.left {
  width: 50%;
  float: left;
  background: red;
  height: 100vh;
}

.right {
  width: 50%;
  float: right;
  background: green;
  height: 100vh;
}

.one {
  width: 100%;
  background: yellow;
  height: 100vh;
  display: block;
  clear: both;
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="left">


  <ul class="pivot-nav">
    <li class="pivot-nav-item"><a class="o-c default-underline custom-scroll-link" href="#one" data-toggle="my-scrollspy-2">1</a></li>


  </ul>

</div>



<div class="one">
  Some more TEXT HERE
</div>
Run Code Online (Sandbox Code Playgroud)

html css jquery

2
推荐指数
1
解决办法
57
查看次数

标签 统计

php ×2

wordpress ×2

css ×1

html ×1

jquery ×1

woocommerce ×1