Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress主题修改显示额外模块_Php_Html_Wordpress - Fatal编程技术网

Php Wordpress主题修改显示额外模块

Php Wordpress主题修改显示额外模块,php,html,wordpress,Php,Html,Wordpress,谢谢你看我的问题。我有一个模板,它在一个3乘3的块中显示帖子,我正在尝试将其扩展到4乘3,我如何才能做到这一点?我已经设法让它在底部创建了一个额外的行,但我在寻找一个额外的列 问题代码如下: <div class="col-xs-12 col-sm-9 col-md-9 col-lg-9"> <div class="row row-adj-gap"> <?php $args = array( 'post_type' => 'po

谢谢你看我的问题。我有一个模板,它在一个3乘3的块中显示帖子,我正在尝试将其扩展到4乘3,我如何才能做到这一点?我已经设法让它在底部创建了一个额外的行,但我在寻找一个额外的列

问题代码如下:

<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">



<div class="row row-adj-gap">
<?php
$args = array( 
            'post_type' => 'post', 
            'posts_per_page' => 9
        );
query_posts( $args );

if ( have_posts() ):
    $lp_cntr = 0;
    while ( have_posts() ) :
    the_post();
    $lp_cntr++;
?>
    <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
        <div class="hvr-wobble-horizontal full-div">

            <a href="<?php get_date(); ?>" class="coverBox">
                <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" class="img-responsive" alt="<?php the_title(); ?>">

                <span><i class="fa fa-braille" aria-hidden="true"></i><?php the_title(); ?></span>
            </a>
            <div class="desp-box">
                <?php the_content(); ?>
            </div>

        </div>
    </div>

    <?php if($lp_cntr%3==0): ?>
</div>
<div class="row row-adj-gap">
    <?php endif; ?>

<?php
    endwhile;
endif;
wp_reset_query();
?>    
</div>

您需要:

  • 通过更改post块上的列大小来减小块宽度(
    col-sm-4
    col-md-4
    col-lg-4
    变为
    col-sm-3
    col-md-3
    )和
  • 通过更改行调制(每行post)计数器增加每行post块数(
    $lp\u cntr%3==0
    变为
    $lp\u cntr%4==0
请参见下面的调整代码:

<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">



    <div class="row row-adj-gap">
    <?php
    $args = array(
                'post_type' => 'post', 
                'posts_per_page' => 9
            );
    query_posts( $args );

    if ( have_posts() ):
        $lp_cntr = 0;
        while ( have_posts() ) :
        the_post();
        $lp_cntr++;
    ?>

        /* Change the following line to decrease block width: */
        <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
            <div class="hvr-wobble-horizontal full-div">

                <a href="<?php get_date(); ?>" class="coverBox">
                    <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" class="img-responsive" alt="<?php the_title(); ?>">

                    <span><i class="fa fa-braille" aria-hidden="true"></i><?php the_title(); ?></span>
                </a>
                <div class="desp-box">
                    <?php the_content(); ?>
                </div>

            </div>
        </div>


        /* Change the following line to increase posts in a row before a break: */
        <?php if($lp_cntr%4==0): ?>
    </div>
    <div class="row row-adj-gap">
        <?php endif; ?>

    <?php
        endwhile;
    endif;
    wp_reset_query();
    ?>    
    </div>

/*更改以下行以减小块宽度:*/
/*更改以下行以在中断前增加行中的立柱:*/
您需要:

  • 通过更改post块上的列大小来减小块宽度(
    col-sm-4
    col-md-4
    col-lg-4
    变为
    col-sm-3
    col-md-3
    )和
  • 通过更改行调制(每行post)计数器增加每行post块数(
    $lp\u cntr%3==0
    变为
    $lp\u cntr%4==0
请参见下面的调整代码:

<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">



    <div class="row row-adj-gap">
    <?php
    $args = array(
                'post_type' => 'post', 
                'posts_per_page' => 9
            );
    query_posts( $args );

    if ( have_posts() ):
        $lp_cntr = 0;
        while ( have_posts() ) :
        the_post();
        $lp_cntr++;
    ?>

        /* Change the following line to decrease block width: */
        <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
            <div class="hvr-wobble-horizontal full-div">

                <a href="<?php get_date(); ?>" class="coverBox">
                    <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>" class="img-responsive" alt="<?php the_title(); ?>">

                    <span><i class="fa fa-braille" aria-hidden="true"></i><?php the_title(); ?></span>
                </a>
                <div class="desp-box">
                    <?php the_content(); ?>
                </div>

            </div>
        </div>


        /* Change the following line to increase posts in a row before a break: */
        <?php if($lp_cntr%4==0): ?>
    </div>
    <div class="row row-adj-gap">
        <?php endif; ?>

    <?php
        endwhile;
    endif;
    wp_reset_query();
    ?>    
    </div>

/*更改以下行以减小块宽度:*/
/*更改以下行以在中断前增加行中的立柱:*/

只需将列类别col-xs-12 col-sm-4 col-md-4 col-lg-4 in更改为


col-xs-12 col-sm-3 col-md-3 col-lg-3

只需将列类col-xs-12 col-sm-4 col-md-4 col-lg-4 in更改为

col-xs-12 col-sm-3 col-md-3 col-lg-3