我的 gulp 设置产生以下错误:
assets\styles\core\_z-indexes.scss
Error: unclosed parenthesis
on line 2 of assets/styles/core/_z-indexes.scss
>> mobile_menu: 40;
---------------^
Run Code Online (Sandbox Code Playgroud)
以下是相关文件的内容。它出什么问题了?
$zIndexes: (
mobile_menu: 40;
);
@function getIndex($zIndexName) {
@return map-get($zIndexes, $zIndexName);
}
Run Code Online (Sandbox Code Playgroud) 创建帖子 ID 的平面数组后,我想通过自定义查询以与数组中相同的顺序显示这些帖子。该文档指出post__in将“保留 post__in 数组中给出的帖子 ID 顺序”。但就我而言,情况并非如此。为什么?
创建我的帖子 ID 数组:
if (have_rows('cases')) :
while (have_rows('cases')) : the_row();
$array_cases[] = get_sub_field('case');
endwhile;
endif;
print_r($array_cases);
Run Code Online (Sandbox Code Playgroud)
结果:
if (have_rows('cases')) :
while (have_rows('cases')) : the_row();
$array_cases[] = get_sub_field('case');
endwhile;
endif;
print_r($array_cases);
Run Code Online (Sandbox Code Playgroud)
WP_Query():
$args = array(
'post_type' => 'iw-project',
'post__in' => $array_cases,
'orderby' => 'post__in'
);
$query_cases = new WP_Query($args);
print_r($query_cases);
Run Code Online (Sandbox Code Playgroud)
结果:
Array
(
[0] => 2959
[1] => 919
[2] => 914
...
)
Run Code Online (Sandbox Code Playgroud)
结果查询结果中的顺序是错误的。第二个和第三个帖子应该是919和914,而不是914和1974。
下面是 WP_Query 对象的原始 SQL:
$args …Run Code Online (Sandbox Code Playgroud) 在某个元素中,我需要选择与某个正则表达式匹配的不同字符串,并用标签包装它们.我怎样才能做到这一点 ?
我试过了 :
var str = jQuery("#my_div").html();
var regex = "\([a-z]{2}\)";
jQuery("#my_div").html(str.replace(regex, "<span>$1</span>"));
Run Code Online (Sandbox Code Playgroud)
..但是这会包裹整个元素而不是元素中的选定字符串.
在购物车中添加内容,点击一些PayPal立即付款按钮,以及成功的PayPal付款(PP或CC)后,用户可能会停留在PayPal网站上,例如,如果未激活自动退货选项(或它是但它不起作用,因为用户是没有PP帐户的访客用户)
用户可以通过单击链接返回该站点,但不必.我的问题是:如果他不这样做,网站所有者将如何知道用户付费以便他现在可以通过邮寄方式发送项目?网站所有者被告知付款似乎对我来说是元素性的,所以我觉得难以理解的是,这种基本的东西留给了一些不起眼的自动返回选项.
请有人向我解释一下吗?
我有3个元素一个在另一个上面.如果我给第二个(粉红色)一个相对位置和负顶值它超过第一个.但第三个没有"跟随",仍然保持原样:
HTML:
<div id='div1'>text</div>
<div id='div2'>text</div>
<div id='div3'>text</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
div {
padding: 50px;
}
#div1 {
background: yellow;
}
#div2 {
background: pink;
position: relative;
top: -50px;
}
#div3 {
background: gray;
}
Run Code Online (Sandbox Code Playgroud)
如何使第三个和它下面的任何其他元素"跟随"粉红色元素?
在Photoshop中,如果将带有白色背景的JPG图像导入带有蓝色的文档中background,则可以background通过将图像设置为“倍增”模式来使图像的白色消失。
我可以单独使用CSS做完全相同的事情吗?
在myfonts.com上我购买了Didot字体,它有常规,粗体,斜体和粗体斜体(每种样式都有一个单独的文件).
当我的WordPress用户使用粗体和斜体字符撰写文章时,我希望使用相应的字体样式.
但到目前为止,它总是使用常规字体,即使是斜体或粗体.因此,我在我的网站上看到的斜体似乎是我常规字体的"斜体版本".但是这个结果与myfonts.com上宣传的真实斜体不同.
他们的客户服务无法用他们自己的话来帮助解决这些"发展问题".如何在我的WordPress网站上为每种样式使用正确的字体文件?
以下是myfonts.com提供的CSS中添加的代码:
@import url("//hello.myfonts.net/count/xxxxx");
@font-face {font-family: 'LinotypeDidoteTextPro';font-weight: normal;font-style: normal;src: url('webfonts/xxxxxxx1.eot');src: url('webfonts/xxxxxxx1.eot?#iefix') format('embedded-opentype'),url('webfonts/xxxxxxx1.woff') format('woff'),url('webfonts/xxxxxxx1.ttf') format('truetype');}
@font-face {font-family: 'LinotypeDidoteTextPro';font-weight: bold;font-style: italic;src: url('webfonts/xxxxxxx2.eot');src: url('webfonts/xxxxxxx2.eot?#iefix') format('embedded-opentype'),url('webfonts/xxxxxxx2.woff') format('woff'),url('webfonts/xxxxxxx2.ttf') format('truetype');}
@font-face {font-family: 'LinotypeDidoteTextPro';font-weight: normal;font-style: italic;src: url('webfonts/xxxxxxx3.eot');src: url('webfonts/xxxxxxx3.eot?#iefix') format('embedded-opentype'),url('webfonts/xxxxxxx3.woff') format('woff'),url('webfonts/xxxxxxx3.ttf') format('truetype');}
@font-face {font-family: 'LinotypeDidoteTextPro';font-weight: bold;font-style: normal;src: url('webfonts/xxxxxxx4.eot');src: url('webfonts/xxxxxxx4.eot?#iefix') format('embedded-opentype'),url('webfonts/xxxxxxx.woff') format('woff'),url('webfonts/xxxxxxx4.ttf') format('truetype');}
Run Code Online (Sandbox Code Playgroud) 对于在页面完全加载(而不仅仅是DOM)后执行的代码,我使用此函数:
jQuery(window).bind("load", function() {
});
Run Code Online (Sandbox Code Playgroud)
但我不能使用dollar里面的标志,只能使用"jQuery".有没有办法使用这个标志?
在结帐页面上,我需要动态修改"查看订单"部分的内容.这很棘手,因为它是Ajax加载的.如何在加载或重新加载Ajax之后运行JS代码,同时确保它不会在它之前运行?
我正在尝试将细分分析提供的代码片段添加到其中nuxt.config.js,但出现以下错误:
FATAL $config 未定义
我究竟做错了什么?
nuxt.config.js:
head: {
script: [
{
hid: 'segment-script',
innerHTML: `
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)...
analytics.load(${this.$config.segmentApiSecret});
analytics.page();
}}();
`,
type: 'text/javascript',
charset: 'utf-8'
}
]
},
privateRuntimeConfig: {
segmentApiSecret: process.env.SEGMENT_API_SECRET
},
Run Code Online (Sandbox Code Playgroud)