Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
Twitter bootstrap 3 Wordpress循环与Bootstrap 3.0_Twitter Bootstrap 3_Wordpress - Fatal编程技术网

Twitter bootstrap 3 Wordpress循环与Bootstrap 3.0

Twitter bootstrap 3 Wordpress循环与Bootstrap 3.0,twitter-bootstrap-3,wordpress,Twitter Bootstrap 3,Wordpress,嘿,下面的人,我有一个有趣的问题。。。。我正在尝试设置一个左侧和右侧的帖子,这样我就可以把诸如阅读更多、发布日期或作者之类的内容放在col-md-4中,并将标题和帖子内容以及阅读更多内容放在col-md-8中 我有一种感觉,我正在处理这个非常奇怪的事情,因为我对我的php和wordpress已经生疏了,所以任何帮助都会很有帮助。有趣的问题是,我有两个read more,其中一个有一个显示:如果我删除页面上的read more,无论出于什么原因,都没有显示 守则: <?php

嘿,下面的人,我有一个有趣的问题。。。。我正在尝试设置一个左侧和右侧的帖子,这样我就可以把诸如阅读更多、发布日期或作者之类的内容放在col-md-4中,并将标题和帖子内容以及阅读更多内容放在col-md-8中

我有一种感觉,我正在处理这个非常奇怪的事情,因为我对我的php和wordpress已经生疏了,所以任何帮助都会很有帮助。有趣的问题是,我有两个read more,其中一个有一个显示:如果我删除页面上的read more,无论出于什么原因,都没有显示

守则:

<?php
                $myposts = get_posts('numberposts=5
                &category=homeposts');
                foreach($myposts as $post) :?>

                <div class="col-md-8" style="background:#000;">
                <h3><a href="<?php echo the_permalink($post->ID); ?>" title="<?php echo $post->post_title;?>">
                <?php echo $post->post_title ?></a></h3>                        
                <?php echo substr($post->post_content,0,500) ?>
                <a class="btn btn-default" style="display:none;" role="button" href="<?php echo get_permalink(); ?>">Read More</a>
                </div>   
                <div class="col-md-4" style="background:#000;"><a class="btn btn-default" role="button" href="<?php echo get_permalink(); ?>">Read More</a></div>
                <?php endforeach; ?> 

好的,那么这有什么不对。。。。

你有什么问题的截图吗?你所说的“疯狂”是什么意思?查看代码,您的readmore permalinks被调用到当前页面/帖子,而帖子的标题本身有一个
带有参数的\u permalink
调用,该调用实际上不接受参数…目前不接受。。。我已经重新编写了一些代码,如果我有更多的问题,我会在这里再次发布。
ok so what is wrong with this....

<?php
                $myposts = get_posts('numberposts=5
                &category=homeposts');
                foreach($myposts as $post) :?>

                <div class="col-md-8">
                <h3><a href="<?php echo the_permalink($post->ID); ?>" title="<?php echo $post->post_title;?>">
                <?php echo $post->post_title; ?></a></h3>                        
                <?php echo $post->the_excerpt; ?>
                <a class="btn btn-default" style="display:none;" role="button" href="<?php echo get_permalink(); ?>">Read More</a>
                </div>   

                <?php endforeach; ?>