我负责管理这个网站F9属性,它是在WordPress中构建的.在主页上有一个特色属性部分.我注意到如果你列出了一个具有两个不同"状态"的属性,例如"For Sale"或"For Lease",该属性在轮播中出现两次.下面是列出特色属性的代码.我可以看到它过滤掉了属性状态为"租用".任何人都可以帮我添加一些代码,每个帖子只列出一个属性,无论它有多少不同的属性状态?
<?php
/* Featured Properties Query Arguments */
$featured_properties_args = array(
'post_type' => 'property',
'posts_per_page' => 100,
'meta_query' => array(
array(
'key' => 'REAL_HOMES_featured',
'value' => 1,
'compare' => '=',
'type' => 'NUMERIC'
)
)
);
$featured_properties_query = new WP_Query( $featured_properties_args );
if ( $featured_properties_query->have_posts() ) :
?>
<section class="featured-properties-carousel clearfix">
<?php
$featured_prop_title = get_option('theme_featured_prop_title');
$featured_prop_text = get_option('theme_featured_prop_text');
if(!empty($featured_prop_title)){
?>
<div class="narrative">
<h3><?php echo $featured_prop_title; ?></h3>
<?php
if(!empty($featured_prop_text)){
?><p><?php echo $featured_prop_text; ?></p><?php
}
?>
</div>
<?php …Run Code Online (Sandbox Code Playgroud) 我正在尝试建立一个非常复杂的"按订单生产"产品的网站.我正在使用WooCommerce,但我意识到它可能不是最好的解决方案,但是,我不是程序员所以我正在尝试使用预先存在的应用程序.作为参考,这里是我正在重新设计的原始网站:http://www.cabinetstogo.com/ic280Collectionfrm_multiple.asp? prodno = TOFFEE- NS*WC - 单击选项卡查看详细信息.
我已经探索了我能找到的所有Woo扩展,例如Product Add Ons,Product Bundles,Grouped Products和Composite Products.目前我在这里使用产品包和复合产品:http: //www.cabinetstogo.company/product/westminster-glazed-toffee-base-cabinets/ - 布局有点乱,但这不是我的问题,问题是,虽然您可以挑选和选择单个产品,但您无法选择单个数量.
使用分组产品:http://www.cabinetstogo.company/product/grouped-test/布局是完美的但我不能将分组产品添加到复合产品中.
理想情况下,我需要做的是:
我已经尝试过Product Add Ons 2,但问题是没有办法为Add Ons设置单独的SKU.
将它们设置为可变产品是另一个想法,但您不能一次选择多个变体.我也考虑过Gravity Forms Add On,但这似乎只是针对其他产品细节而不是混合和匹配功能.
我知道没有简单的解决方案,但任何指向正确的方向都会有所帮助,因为我可以想到所有不同的方式,我不知道从哪里开始.
网站链接:http://nuestrafrontera.org/wordpress/
我希望最近的帖子标题的提要在侧栏中显示所有3种语言,用语言分隔.因此,例如,在最近的帖子下,侧边栏将有"英语",然后是最新的3个英文帖子,然后是"Español",最新的3个用西班牙语,然后是法语.全部在列的列表中,并显示在所有语言的侧栏上的所有页面上.
我正在使用最新版本的Wordpress和WPML插件.
我相信最近帖子的Wordpress小部件需要调整才能做到这一点.这是代码(来自wp-includes/default-widgets.php):
class WP_Widget_Recent_Posts extends WP_Widget {
function WP_Widget_Recent_Posts() {
$widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your blog") );
$this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops);
$this->alt_option_name = 'widget_recent_entries';
add_action( 'save_post', array(&$this, 'flush_widget_cache') );
add_action( 'deleted_post', array(&$this, 'flush_widget_cache') );
add_action( 'switch_theme', array(&$this, 'flush_widget_cache') );
}
function widget($args, $instance) {
$cache = wp_cache_get('widget_recent_posts', 'widget');
if ( !is_array($cache) )
$cache = array();
if ( isset($cache[$args['widget_id']]) ) {
echo $cache[$args['widget_id']];
return;
}
ob_start();
extract($args); …Run Code Online (Sandbox Code Playgroud)