後職位所以我必須獲得職位的電流方式:WordPress的獲取某一日期SQL查詢問題
<?php
$args2 = array('post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'order' => 'ASC');
?>
<?php $attachments2 = get_posts($args2); ?>
<?php
if ($attachments2) { ?> ...do stuff...
,但我需要做的,如果他們是2012年3月1日以後公佈的只是收集帖子的..
所以我不知道該怎麼做 - 我被告知要做一個SQL語句,但不知道從哪裏開始。
你們會怎麼做?
編輯:
下面是完整的功能,因爲它主張:
<?php
$args2 = array('post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'order' => 'ASC');
?>
<?php $attachments2 = get_posts($args2); ?>
<?php
if ($attachments2) { ?>
<h1 style='float:left'>Photos from the session</h1>
<?php foreach ($attachments2 as $attachment) { ?>
<?php if($attachment->ID != $post_thumbnail_id){ ?>
<div style="width:100%; height:auto;">
<div style="float:left; width: auto; height:auto;">
<?php echo wp_get_attachment_image($attachment->ID, 'full'); ?>
<div style="width:auto; height:49px; background-color:#FFF; display:block; width:100%; float:left; margin-bottom:15px;"><div class="floatiefooterright"></div></div>
</div>
<?php $desc = apply_filters('the_content', $attachment->post_content);
if($desc != ''){ ?>
<div style="width:auto; height:auto; margin:10px; display:block; float:left;">
<hr class="contentseperator" />
<?php if($desc != ''){ ?>
<em><?php echo $desc ?></em>
<?php } ?>
</div>
<?php } ?>
</div>
<?php }; //end of the "if not featured image"?>
<?php }?>
<?php }?>
我有點困惑,因爲如何在我正在做的事情中使用它... – 2012-03-06 23:55:56
所以我已經在我的文章中添加了一部分,它顯示了該函數如何生成HTML ...您是否介意稍微我對此有更深入的瞭解?傳說! – 2012-03-06 23:56:30