WP DOWNLOAD MANAGER

时间:2016-04-05 21:59:08

标签: php wordpress wordpress-plugin

我试图在我的主页上显示最近的下载帖子。使用WP_query。

但我没有得到任何显示或错误。

WPDOWNLOADMANAGER是一个拥有自己类别的下载插件。

   <?php
          $args = array(
            'post_per_page' => 1,
            'post_type' => 'document',
            'paged' => get_query_var('paged')
          );
         $homepage_query = new WP_Query($args);   
          $paged = get_query_var('paged') ? get_query_var('paged') : 1;

      ?>
        <?php if (have_posts() ) : while ($homepage_query->have_posts() ) : $homepage_query->the_post(); ?>


       <div class="post-list-item">
        <div class="row no-gutters">
          <div class="col-lg-3 post-item-type">
            <i class="fa fa-file-text-o"></i>
            <a href="<?php the_permalink();?>"><button class="btn btn-green">View Document</button></a>
          </div>
          <div class="col-lg-9 post-item-panel">
            <div class="post-title">
                <span><?php the_title();?></span>
            </div>
            <div class="post-excerpt">
              <p><?php echo substr(get_the_excerpt(), 0,160); printf( '<a class="read-more" href="%1$s">%2$s</a>', get_permalink( get_the_ID() ), __( ' ...Read More', 'textdomain' )
); ?></p>
            </div>
          </div><!--//post-item-panel-->
        </div><!--row-no-gutters-->
      </div><!--//post-list-item-->

        <?php endwhile; endif; wp_reset_query(); ?>
        <?php
          if ( function_exists('wp_bootstrap_pagination') )
          wp_bootstrap_pagination();
        ?>

1 个答案:

答案 0 :(得分:0)

确定。大声笑再次弄错了。

function onFormSubmit(e) 
{
 var ss = SpreadsheetApp.getActiveSheet();
 var lastRowInx = ss.getLastRow(); // Get the row number of the last row with content
 var createDateColumn = ss.getMaxColumns(); //CreateDateColumn is currently in AX (Column 50) which is the last/max column position

  var createDate = setCreateDate(ss, lastRowInx, createDateColumn);
}//This is the end of onFormSubmit
function setCreateDate(ss, lastRowInx,createDateColumn) // Stores the create date timestamp in Column AV on the backend
{
  if (ss.getRange(lastRowInx, createDateColumn).getValue() == "") // so that subsequent edits to Google Form which trigger timestamp updates don't overwrite original create date
  {
    var timestamp = ss.getRange(lastRowInx, 1).getValue(); // Get timestamp entry which is currently in A (Column 1)
    var setDate = ss.getRange(lastRowInx, createDateColumn);
    var createDate = new Date(timestamp);
    setDate.setValue(createDate).setNumberFormat("MM/dd/yyyy hh:mm:ss");
  }
  else {} //should do nothing
  return createDate;
}//This is the end of setCreateDate function