我有一个图像,当我在悬停时模糊它,它稍微移动,就像图像在它的位置抖动,问题只发生在chrome(测试时使用:chromium 63 linux-x86_64),
.item img{
transition: 250ms all ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.item:hover img{
filter: blur(2px)
}
Run Code Online (Sandbox Code Playgroud)
我认为它可能与这个问题有关,但没有一个解决方案有效.
更新:
正如@Chase所说,这是一个chrome bug,最稳定的解决方案是等待它被修复.但就目前而言,这个问题的最佳解决方案是@kosh Very的答案
我怎样才能在 CSS 中实现这样的事情?
我已经尝试了很多方法,但深色背景仍然挡住了并且无法剪裁,因此它下面的背景图像不可见......
.item {
position: relative;
}
.item:before {
content: '';
size(100%);
top: 0;
left: 0;
z-index: 1;
background: rgba(0, 0, 0,0 0.1);
}Run Code Online (Sandbox Code Playgroud)
<div class="item">
<img>
<span class="rate">
<span class="amount">10</span> ??????
</span>
</div> Run Code Online (Sandbox Code Playgroud)
我正在寻找一种能够使部分深色背景透明的方法,以便可以看到图像。
我们有一个销售电脑零件的网站,这个网站上有一个名为"组装你的电脑"的部分,允许用户选择零件(主板 - cpu - ram等)并支付价格并获得他们的组装产品,一切正常很好,但它需要一个选项来添加"装配费"到购物车.仅当用户通过"组装您的PC"向导过程时才应添加此费用.我正在使用此代码,但它将其添加到所有购物车,我的意思是它不是有条件的.
public function calculate_fees( $fees ){
global $woocommerce;
$cart_subtotal = $woocommerce->cart->subtotal;
$additional_fee = 0; // Additional fee
$additional_fee_text = __('Assembling fee : ', 'dornaweb');
if( $_POST['assembly_fee'] === 'flat_assembly_rate' ){
$additional_fee = intval( dw_option('flat_assembly_rate') ) ?: 0; // flat assembly fee
$additional_fee_text .= __(' ( assembly, no warranty )', 'dornaweb');
} elseif( $_POST['assembly_fee'] === 'percentage_assembly_fee' ) {
$additional_fee = dw_option('percentage_assembly_fee') ? ( ( intval( dw_option('percentage_assembly_fee') ) / 100 ) * $cart_subtotal ) : 0; // percentage assembly …Run Code Online (Sandbox Code Playgroud) 我使用 PHP 和 Curl 连接到 FTP 服务器,奇怪的是,当我在本地设置中尝试我的代码时,它以隐式 TLS 和显式 TLS 方式工作,但是当我在任何服务器上运行相同的代码时,它不会不工作并返回Connection refused。
PHP代码是:
<?php
function simple_list_test() {
$curlopts = [];
$debug = true;
$return = null;
$curlopts[CURLOPT_USERPWD] = "{$user}:{$password}";
$curlopts[CURLOPT_SSL_VERIFYPEER] = false;
$curlopts[CURLOPT_SSL_VERIFYHOST] = false;
$curlopts[CURLOPT_FTP_SSL] = CURLFTPSSL_TRY;
$curlopts[CURLOPT_FTPSSLAUTH] = CURLFTPAUTH_TLS;
$curlopts[CURLOPT_RETURNTRANSFER] = true;
$curlopts[CURLOPT_URL] = "ftp://ftp.avidafinance.com:21/"; // I tried with ftps:// protocol too it works on local but not when you run it on a hosting
$curlopts[CURLOPT_FTPLISTONLY] = 1;
$curlopts[CURLOPT_UPLOAD] = 0;
$curlopts[CURLOPT_RETURNTRANSFER] = 1;
$ch = …Run Code Online (Sandbox Code Playgroud) 嗨,我想在wordpress中创建一个类别树,如下所示:
<ul>
<a href=""> PARENT1 </a>
<li><a href=""> CHILD 1-1</a></li>
<li><a href=""> CHILD 1-2</a></li>
.
.
.
</ul>
<ul>
<a href=""> PARENT2 </a>
<li><a href=""> CHILD 2-1</a></li>
<li><a href=""> CHILD 2-2</a></li>
.
.
.
</ul>
Run Code Online (Sandbox Code Playgroud)
我想要一些以上述格式创建类别列表的东西,只显示有孩子的类别并隐藏那些没有孩子的类别
我试过这样的东西,但它没有给我我想要的东西
<?php $args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 0,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'taxonomy' => 'category',
'pad_counts' => false
);
$cats = …Run Code Online (Sandbox Code Playgroud) 我对 Wordpress 中的 RSS 提要进行了一些更改,我正在使用fetch_feed()向另一个网站显示数据。假设有 2 个网站,分别称为 #Wordpress1 和 #Wordpress2。这是我添加到#wordpress1functions.php文件中的代码
add_action('rss2_item', 'dw_add_data_to_rss');
function dw_add_data_to_rss(){
global $post;
if( $post->post_type == 'product' ) {
$product = new WC_Product( $post->ID );
$output = '';
$thumbnail_ID = get_post_thumbnail_id( $post->ID );
$thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail');
$output = '<post-thumbnail>';
$output .= '<url>'. $thumbnail[0] .'</url>';
$output .= '<width>'. $thumbnail[1] .'</width>';
$output .= '<height>'. $thumbnail[2] .'</height>';
$output .= '</post-thumbnail>';
$output .= '<price>' . number_format( $product->get_price() ) . ' ' . get_woocommerce_currency_symbol() . '</price>';
echo …Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个 wordpress 自定义查询 ( WP_Query),它按评级限制过滤帖子。这个评分是一个介于 0 和 10 之间的数字,它也可能是浮点数(例如 6.8),我试过这段代码,但它不起作用:(
<?php
$ratings = array( 4, 7 ); // this is an example , ratings are dynamic
$args = array(
'post_type' => 'product',
'showposts' => -1,
'meta_query' => array(
array(
'key' => 'aps-product-rating-total', // floating number
'value' => $ratings,
'type' => 'DECIMAL',
'compare' => 'BETWEEN'
)
);
);
$filter_result = new WP_Query( $args );
?>
Run Code Online (Sandbox Code Playgroud) 今天我遇到了这个奇怪的问题,它让我大吃一惊,因为我不知道为什么会发生这种情况,我有一个包含此操作的表单,http://localhost/wp/但如果末尾没有反斜杠,它就不起作用,我的意思是,当该操作是它时,http://localhost/wp它就不起作用不工作,让我用例子向你展示:
<form action="<?php bloginfo("url"); ?>" method="post">
<input type="text" name="example">
</form>
<?php
var_dump( $_POST ); // will output an empty array
?>
Run Code Online (Sandbox Code Playgroud)
"/"但现在我们在操作网址末尾添加一个它可以工作,但我希望它能以两种方式工作,因为我正在为客户设计这个网站。
<form action="<?php bloginfo("url"); ?>/" method="post">
<input type="text" name="example">
</form>
<?php
var_dump( $_POST ); // will output array( "example" => "XXXX" )
?>
Run Code Online (Sandbox Code Playgroud)
谁能告诉我出了什么问题!!
:: 它是安装在 XAMPP 上的 WordPress - Windows 8.1
我需要$counter在我的循环中使用一个返回如下系列:
1 2 2 1 1 2 2 1
可悲的是,我对数学并不是那么好,无论我尝试什么都达到了死胡同.这是我尝试的最后一件事.
$counter = 0;
while( statement ) {
++$counter;
// Making sure the second element is loaded
if( $counter > 2 )
$twoloaded = true;
if( $counter >= 2 )
--$counter;
echo '<article class="post post-style-' . $counter . '"> ....... </article>';
}
Run Code Online (Sandbox Code Playgroud)
最后我需要输出这样的HTML:
<article class="post post-style-1">
...
</article>
<article class="post post-style-2">
...
</article>
<article class="post post-style-2">
...
</article>
<article class="post post-style-1">
...
</article>
<article class="post post-style-1">
...
</article>
<article …Run Code Online (Sandbox Code Playgroud) 最近,我读了很多有关使用schema.org标记结构化数据的信息,第一个问题是,建议完全使用它json-ld吗?因为它似乎是新的,尚未得到完全支持。我的第二个问题是在主页或存档页面(通常是其中包含多个文章或产品或博客文章的页面)上,我如何使用schema.org?例如这样的页面:
<!DOCTYPE html>
<html>
<head>
<title>Blog Home Page</title>
</head>
<body>
<h1>Blog title</h1>
<!-- this needs schema.org -->
<article>
<h2>Article title</h2>
Writtem by <span>Authorname</span> on <time datetime="">21 april</time>
<p>
Some text
</p>
Rated :
<div class="star-rate">
<span class="star full">
<span class="star full">
<span class="star full">
<span class="star half">
<span class="star empty">
</div>
By <span>5</span> users.
</article>
<article>
<h2>Article title</h2>
Writtem by <span>Authorname</span> on <time datetime="">21 april</time>
<p>
Some text
</p>
Rated :
<div class="star-rate">
<span class="star full">
<span class="star …Run Code Online (Sandbox Code Playgroud) php ×6
wordpress ×5
css ×2
html ×2
cart ×1
css-filters ×1
curl ×1
ftp ×1
html5 ×1
json-ld ×1
loops ×1
math ×1
rss ×1
schema.org ×1
series ×1
simplepie ×1
ssl ×1
transparency ×1
woocommerce ×1