我正在尝试将外部嵌入代码添加到我的Gatsby页面.
我目前正在使用
import React from 'react'
import Link from 'gatsby-link'
let test ="<script type='text/javascript'>
(function(d, s) {
var useSSL = 'https:' == document.location.protocol;
var js, where = d.getElementsByTagName(s)[0],
js = d.createElement(s);
js.src = (useSSL ? 'https:' : 'http:') + '//www.peopleperhour.com/hire/1002307300/1213788.js?width=300&height=135&orientation=vertical&theme=light&rnd='+parseInt(Math.random()*10000, 10);
try { where.parentNode.insertBefore(js, where); } catch (e) { if (typeof console !== 'undefined' && console.log && e.stack) { console.log(e.stack); } }
}(document, 'script'));
</script>"
const ContactPage = () => (
<div>
<h1>ContactPage</h1>
<div
dangerouslySetInnerHTML={{ __html: test }}
/>
</div> …Run Code Online (Sandbox Code Playgroud) 我一直在尝试导出我的WordPress帖子,以便将它们导入干净的WordPress安装.导入的帖子,但不导入特色图像.
我已确保导出少量帖子以排除超时错误.
我看了一下导出的xml,找不到带有相关jpg的xml值.这是我的导出xml中的一个帖子项目(为隐私编辑):
我注意到"_thumbnail_id"的元键.
<item>
<title> MY POST TITLE </title>
<link>http://www.MY-DOMAIN-NAME.com/MY POST TITLE/</link>
<pubDate>Mon, 01 Jul 2013 17:31:11 +0000</pubDate>
<dc:creator> AUTHOR </dc:creator>
<guid isPermaLink="false">http://www.MY-DOMAIN-NAME.com/?p=12429</guid>
<description></description>
<content:encoded><![CDATA[http://youtu.be/VIDEOCODE
<a href="http://www.MY-DOMAIN-NAME.com/?s=MY+QUERY" class="mo">Read More...</a>]]>
</content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>12429</wp:post_id>
<wp:post_date>2013-07-01 12:31:11</wp:post_date>
<wp:post_date_gmt>2013-07-01 17:31:11</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>MY-POST-TITLE</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="music-videos"><![CDATA[Music
Videos]]></category>
<category domain="post_tag" nicename="MY-TAG"><![CDATA[RMY TAG]]>
</category>
<category domain="category" nicename="reggae-music-video"><![CDATA[Reggae Music Videos]]></category>
<category domain="category" nicename="video"><![CDATA[Video]]></category>
<wp:postmeta>
<wp:meta_key>_edit_last</wp:meta_key>
<wp:meta_value><![CDATA[9]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_thumbnail_id</wp:meta_key>
<wp:meta_value><![CDATA[12431]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>robotsmeta</wp:meta_key>
<wp:meta_value><![CDATA[index,follow]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key>_oembed_c0627bbe93a4ea2be1138b1197ad7c</wp:meta_key>
<wp:meta_value><![CDATA[<iframe width="500" height="281" …Run Code Online (Sandbox Code Playgroud) 在WooCommerce中,我需要为特定支付网关应用自定义处理费.我从这里得到这段代码:如何向WooCommerce Checkout添加处理费.
这是我的代码:
add_action( 'woocommerce_cart_calculate_fees','endo_handling_fee' );
function endo_handling_fee() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$fee = 5.00;
$woocommerce->cart->add_fee( 'Handling', $fee, true, 'standard' );
}
Run Code Online (Sandbox Code Playgroud)
此功能为所有交易添加费用
是否可以调整此功能并使其仅适用于货到付款?
另一个问题是我希望这笔费用适用于购物车.可能吗?
我也欢迎任何替代方法.我知道类似的"支付网关费用"woo插件,但我负担不起.
我有一个列表:
<ul>
<li>Something</li>
<li class="class1">Important</li>
<li>I want this</li>
<li>I want this</li>
<li class="class1">Important</li>
<li>I want this</li>
<li>I want this</li>
<li>Something</li>
<li>Something</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
<li>每个.class1元素后面的第二个是否有CSS选择器?
wordpress ×2
checkout ×1
css ×1
export ×1
gatsby ×1
javascript ×1
php ×1
reactjs ×1
woocommerce ×1