Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.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 如何将要素内容放置在店铺内容下方_Php_Html_Css_Wordpress_Wordpress Theming - Fatal编程技术网

Php 如何将要素内容放置在店铺内容下方

Php 如何将要素内容放置在店铺内容下方,php,html,css,wordpress,wordpress-theming,Php,Html,Css,Wordpress,Wordpress Theming,我想在我的商店内容之后放置一些功能内容,但是商店内容是在php文件中生成的,功能内容是在wordpress页面中以静态html编写的。功能内容显示在商店内容之前,我需要切换它 网页位于: 以下是当前页面的外观: 以下是商店内容的php代码: <?php /** * Loop shop template * * DISCLAIMER * * Do not edit or add directly to this file if you wish to upgrade Jigosh

我想在我的商店内容之后放置一些功能内容,但是商店内容是在php文件中生成的,功能内容是在wordpress页面中以静态html编写的。功能内容显示在商店内容之前,我需要切换它

网页位于:

以下是当前页面的外观:

以下是商店内容的php代码:

<?php
/**
 * Loop shop template
 *
 * DISCLAIMER
 *
 * Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer
 * versions in the future. If you wish to customise Jigoshop core for your needs,
 * please use our GitHub repository to publish essential changes for consideration.
 *
 * @package    Jigoshop
 * @category   Catalog
 * @author     Jigowatt
 * @copyright  Copyright (c) 2011 Jigowatt Ltd.
 * @license    http://jigoshop.com/license/commercial-edition
 */
?>

<?php
global $columns, $per_page;

do_action('jigoshop_before_shop_loop');

$loop = 0;

if (!isset($columns) || !$columns) $columns = apply_filters('loop_shop_columns', 4);
//if (!isset($per_page) || !$per_page) $per_page = apply_filters('loop_shop_per_page', get_option('posts_per_page'));

//if ($per_page > get_option('posts_per_page')) query_posts( array_merge( $wp_query->query, array( 'posts_per_page' => $per_page ) ) );

ob_start();

if (have_posts()) : while (have_posts()) : the_post(); $_product = &new jigoshop_product( $post->ID ); $loop++;

    ?>
    <li class="product <?php if ($loop%$columns==0) echo 'last'; if (($loop-1)%$columns==0) echo 'first'; ?>">

        <?php do_action('jigoshop_before_shop_loop_item'); ?>

        <a href="<?php the_permalink(); ?>">

            <?php do_action('jigoshop_before_shop_loop_item_title', $post, $_product); ?>

            <strong><?php the_title(); ?></strong>

            <?php do_action('jigoshop_after_shop_loop_item_title', $post, $_product); ?>

        </a>

        <?php do_action('jigoshop_after_shop_loop_item', $post, $_product); ?>

    </li><?php

    if ($loop==$per_page) break;

endwhile; endif;

if ($loop==0) :

    echo '<p class="info">'.__('No products found which match your selection.', 'jigoshop').'</p>';

else :

    $found_posts = ob_get_clean();

    echo '<ul class="products">' . $found_posts . '</ul><div class="clear"></div>';

endif;

do_action('jigoshop_after_shop_loop');


此行创建产品列表:

echo '<ul class="products">' . $found_posts . '</ul><div class="clear"></div>';
显然,这不是最整洁的解决方案,但它应该完成工作。理想情况下,您也希望通过数据库提取功能内容

此外,还可以创建一个函数,该函数根据传递给它的功能项ID检索相关信息。您可以在产品中循环并调用函数为您生成HTML字符串,而不必手动创建它们

echo '<ul class="products">' . $found_posts . '</ul><div class="clear"></div>';
$product_string = "";
$product_string = "<ul class='products'>" . $found_posts . "</ul><div class='clear'></div>";
$product_string .= "<div class='entry-content'><h1 class='description-title'>WHY IS BOLI BETTER?</h1>";

/* First Product */
$product_string .= "<div class='feature feature-item-248'><img class='main' src='http://www.bolistylus.com/wp-content/uploads/uclaproduct.png' alt='' /><div class='feature_description'><div class='feature_description_header'><h2 class='descript-heading'>PERFECTLY WEIGHTED</h2></div><div class='feature_description_content'>Touch screens have simplified technology, but there has yet to be a way to capture the precision of a calligrapher or the stroke of an artist. Not only should it meet your needs, but a stylus should have style.</div></div></div>";

$product_string .= "</div>";
echo $product_string;