我试图通过设置这样的html来制作颜色选择器:
<ol class="kleurenkiezer list-reset clearfix">
<li>
<input type="radio" id="kleur_wit" name="kleurenkiezer" value="wit">
<label for="kleur_wit" style="background: white;"></label>
</li>
<li>
<input type="radio" id="kleur_creme" name="kleurenkiezer" value="creme">
<label for="kleur_creme" style="background: #fffceb;"></label>
</li>
<li>
<input type="radio" id="kleur_lichtbruin" name="kleurenkiezer" value="lichtbruin">
<label for="kleur_lichtbruin" style="background: #968272;"></label>
</li>
<li>
<input type="radio" id="kleur_bordeauxrood" name="kleurenkiezer" value="bordeauxrood">
<label for="kleur_bordeauxrood" style="background: #941514;"></label>
</li>
<li>
<input type="radio" id="kleur_oudgroen" name="kleurenkiezer" value="oudgroen">
<label for="kleur_oudgroen" style="background: #7fa298;"></label>
</li>
<li>
<input type="radio" id="kleur_lichtblauw" name="kleurenkiezer" value="lichtblauw">
<label for="kleur_lichtblauw" style="background: #487eae;"></label>
</li>
<li>
<input type="radio" id="kleur_oudgeel" name="kleurenkiezer" value="oudgeel">
<label for="kleur_oudgeel" style="background: …Run Code Online (Sandbox Code Playgroud) 我想要做的是通过2个坐标之间的距离过滤一堆wordpress帖子.用户输入的坐标,范围和类别在URL中传递,如下所示:
/?cat=0&s=5041GW&range=250&lat=51.5654368&lon=5.071263999999928
Run Code Online (Sandbox Code Playgroud)
然后有一些帖子(不是全部)有一个lat和long字段,我使用插件高级自定义字段创建.这些是我传递给get_posts以获取按类别过滤的帖子的参数:
$args = array(
'posts_per_page' => 24,
'category' => $_GET["cat"],
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'adressen',
'post_status' => 'publish',
);
Run Code Online (Sandbox Code Playgroud)
现在我要做的就是修改它,以便在实际传递范围和位置时,帖子将被过滤为仅返回位置在用户搜索位置的范围(以千米为单位)内的帖子.我似乎无法找到一个好的解决方案,因为我很难使用wordpress及其插件.我真的很感激我能理解的解决方案.
我有一个容器中的域名检查表单.提交表单后,将检查域名的可用性,并在与表单相同的容器中显示一条消息.当显示消息时,我希望表单和第一个H2消失.我怎样才能做到这一点?
我的代码:
<div id="domain-name-check">
<h2>Is uw domeinnaam nog vrij?</h2>
<form method='post' class="clearfix">
<input type=text name=domain>
<select name="suffix">
<option value=".nl">.nl</option>
<option value=".be">.be</option>
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".biz">.biz</option>
<option value=".info">.info</option>
<option value=".mobi">.mobi</option>
<option value=".ws">.ws</option>
<option value=".cc">.cc</option>
</select>
<input type=submit name=proses value=Check>
</form>
<?php
if(isset($_POST['proses'])){
$domain_name = "$_POST[domain]"."$_POST[suffix]";
$arrHost = @gethostbynamel("$domain_name");
$date = date('y-m-d');
if(empty($arrHost)){
echo "<h2>$domain_name is beschikbaar</h2> <a href='/offerte-aanvragen/".$domain_name."/'>Vraag een offerte aan</a>";
$availability = "yes";
}else{
echo "<h2>$domain_name is helaas bezet</h2> <a href='/offerte-aanvragen/".$domain_name."/verhuizen/'>Verhuis uw domein</a>";
$availability = "no"; …Run Code Online (Sandbox Code Playgroud) 我正在使用看起来像这样的模式匹配来编写Haskell函数.
printLine :: [Int] -> [String]
printLine [] = error "Lege lijst levert niets op"
printLine [x] = "+" : replicate x "-"
printLine (x:xs) = ('+' : replicate x "-") : printLine xs
Run Code Online (Sandbox Code Playgroud)
基本案例工作,但GHC给出了一个错误的递归情况,如下所示:
Couldn't match expected type `Char' with actual type `[Char]'
In the second argument of `replicate', namely `"-"'
In the second argument of `(:)', namely `replicate x "-"'
In the first argument of `(:)', namely `('+' : replicate x "-")'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?请记住,我是Haskell的初学者和一般的函数式编程.我希望有人可以帮助我.
我正在尝试编写一个函数,从所有可以选择的卡中挑选一张随机卡.卡片属于我声明的名为rank的类型.我的代码看起来像这样:
data Rank = Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten
| Jack | Queen | King
deriving(Eq, Ord, Bounded, Enum, Show, Read)
pickCard :: Rank
pickCard = error "How should I pick a random card here? :("
Run Code Online (Sandbox Code Playgroud)
当然我想要这个函数做的是从列表中选择一个随机值[Ace .. King]我该怎么做?请记住,我是Haskell的初学者和一般的函数式编程.
我正在尝试使用WP_Query和一些参数在wordpress中检索一些页面:
$args = array(
'post_type' => 'posttype',
'posts_per_page' => 24,
'post__in' => $store_ids,
'paged' => $paged,
'post_status' => 'publish',
);
$the_query = new WP_Query( $args );
Run Code Online (Sandbox Code Playgroud)
我要在此处检索的页面应与我提供的ID数组中的ID相匹配。数组和其他参数看起来不错,因为当我使用get_posts而不是时确实得到了结果WP_Query。这是怎么了?