Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.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 如何使用Magento的位置框排序数组_Php_Magento_Fishpig - Fatal编程技术网

Php 如何使用Magento的位置框排序数组

Php 如何使用Magento的位置框排序数组,php,magento,fishpig,Php,Magento,Fishpig,我使用的是Magento和WordPress,所以我选择了FishPig模块。我有一个CMS页面,正在使用assocaited blog posts选项卡选择要在此页面上显示的帖子,这些帖子都按预期工作 我面临的问题是,当我尝试使用Magento中每个选定帖子旁边的位置框时,无论我将它们设置为什么顺序,它们在前端始终保持相同的顺序 我知道在Magentos类别中,你可以使用相同的位置框来订购产品在特定类别上的显示方式,因此我想使用相同的功能来订购下面的代码,但我无法找到如何使其工作 &l

我使用的是Magento和WordPress,所以我选择了FishPig模块。我有一个CMS页面,正在使用assocaited blog posts选项卡选择要在此页面上显示的帖子,这些帖子都按预期工作

我面临的问题是,当我尝试使用Magento中每个选定帖子旁边的位置框时,无论我将它们设置为什么顺序,它们在前端始终保持相同的顺序

我知道在Magentos类别中,你可以使用相同的位置框来订购产品在特定类别上的显示方式,因此我想使用相同的功能来订购下面的代码,但我无法找到如何使其工作

    <?php if (($posts = $this->getPostCollection()) !== false): ?>
    <?php if (count($posts) > 0): ?>
        <div class="box-collateral box-description" style="padding:5px 20px;">
            <!--<?php if ($title = $this->getTitle()): ?>
                <h2 style="margin-bottom:15px;">Blog <span style="color: #68d088;">Posts</span></h2>

            <?php endif; ?>-->
            <div class="std">
                <ul>
                <?php foreach($posts as $post): ?>
                    <li class="related-blogs">
                        <a href="<?php echo $post->getPermalink() ?>"><h2><?php echo $this->escapeHtml($post->getPostTitle()) ?></h2></a>
                        <div class="content">
                            <?php 
                                $pos = strpos($post['post_content'], ' ', 300);
                                echo substr($post['post_content'],0,$pos );
                            ?>
                        </div>
                        <a style="color:#68d088; font-weight:bold;" href="<?php echo $post->getPermalink() ?>">Read More...</a>
                    </li>
                <?php endforeach; ?>
                </ul>
            </div>
        </div>
    <?php endif; ?>
    <?php endif; ?>

您是关联帖子还是关联类别?如果您使用的是类别,则无法定位这些类别,但只能在帖子上进行发布。@BenTideswell我正在关联CMS页面上的帖子