我有24天每天都有独特的信息.我怎样才能在某种循环中编写以下IF语句以提高效率: -
<?
if ($day == '1') {
$offerTxt = $day1Txt;
} else if ($day == '2') {
$offerTxt = $day2Txt;
} else if ($day == '3') {
$offerTxt = $day3Txt;
} else if ($day == '4') {
$offerTxt = $day4Txt;
} else if ($day == '5') {
$offerTxt = $day5Txt;
} else if ($day == '6') {
$offerTxt = $day6Txt;
}
?>
Run Code Online (Sandbox Code Playgroud) 我需要编写wp_list_categories自定义函数等等,而不是显示链接的分级列表,他们是不是与父词条被显示为H3标签复选框列表.
最终的输出看起来像http://jsfiddle.net/amesy/kwqpf5fv/6/
这是我的WordPress模板文件中的PHP代码...
<?php
//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
$taxonomy = 'tags';
$orderby = 'name';
$show_count = 1; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$args = array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => …Run Code Online (Sandbox Code Playgroud) 我需要自动在静态(.html)页面中创建链接列表,有没有办法使用JavaScript执行此操作.我累了几个脚本,但无法解决.
这是我的HTML ...
<a href="1.html"><img src="images/1.jpg" width="119" height="121" alt="" /></a>
Run Code Online (Sandbox Code Playgroud)
这就是我希望脚本生成55次...
<a href="1.html"><img src="images/1.jpg" width="119" height="121" alt="" /></a>
<a href="2.html"><img src="images/2.jpg" width="119" height="121" alt="" /></a>
<a href="3.html"><img src="images/3.jpg" width="119" height="121" alt="" /></a>
Run Code Online (Sandbox Code Playgroud)
...等等,叫我懒,但任何帮助都会非常感激:)
我需要获取子页面列表,但我需要排除第一个孩子.我还需要显示一个名为'page_icon'的自定义图像字段,其中包含网址和页面标题.这将作为将在每个子页面上显示的子菜单.每个菜单项都需要将当前类附加到a标记.我已经尝试了许多不同的方法并没有运气,因为我的技能水平充其量只是初学者.
父ID是1064,自定义字段称为"page_icon",它是使用ACF设置的
当前菜单硬编码到编辑器中,html如下所示: -
<div id="attachment_1306" style="width: 160px" class="wp-caption alignleft"><a class="icon on" href="http://www.domain.co.uk/category/category/category/"><img class="wp-image-1306 size-thumbnail" title="Policy Manager" src="http://www.domain.co.uk/wp-content/uploads/2013/05/docs-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Policy Manager</p></div>
<div id="attachment_1297" style="width: 160px" class="wp-caption alignleft"><a class="icon" href="http://www.domain.co.uk/category/category/category/"><img class="wp-image-1297 size-thumbnail" title="Risk Manager" src="http://www.domain.co.uk/wp-content/uploads/2013/05/risk-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Risk Manager</p></div>
<div id="attachment_1307" style="width: 160px" class="wp-caption alignleft"><a class="icon" title="Controls Manager" href="http://www.domain.co.uk/governance-risk-and-category/category/category/"><img class="wp-image-1307 size-thumbnail" title="Controls Manager" src="http://www.domain.co.uk/wp-content/uploads/2013/05/controls-150x150.png" alt="" width="150" height="150" /></a><p class="wp-caption-text">Controls Manager</p></div>
<div id="attachment_1301" style="width: 160px" class="wp-caption alignleft"><a class="icon" title="Incident Manager" href="http://www.domain.co.uk/category/category/category/"><img class="wp-image-1301 size-thumbnail" title="Incident Manager" src="http://www.domain.co.uk/wp-content/uploads/2013/05/incident-150x150.png" alt="" …Run Code Online (Sandbox Code Playgroud)