早上好,
我已经创建了一个自定义帖子类型 - 产品 - 并且对于该自定义帖子类型,我创建了一个自定义字段 - featured_product - 使用高级自定义字段插件.当我创建自定义字段时,我使用True/False字段类型.
我正在尝试仅显示选中featured_product复选框的那些产品帖子.
这是我目前的代码:
<?php query_posts(array(
'posts_per_page' => 3,
'post_type' => 'products',
'orderby' => 'post_date',
'paged' => $paged
)
); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php if(get_field('featured_product')){ ?>
<div id="post-<?php the_ID(); ?>" class="cpt">
<h2><?php the_title(); ?></h2>
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail('excerpt');
}
?>
<?php the_excerpt(); ?>
<ul class="prod_detail">
<li><a href="<?php the_field('product_detail_page'); ?>">Learn More</a></li>
<li><a href="<?php the_field('purchase_link'); ?>">Place Order</a></li>
</ul>
</div>
<?php } …
Run Code Online (Sandbox Code Playgroud) 我正在使用Joomla 3.2开发网站。我想在自定义HTML模块内放置一个搜索框。我启用了模块加载插件,为搜索框('searchbox')定义了模块位置,创建了模块实例,将其分配到正确的位置,启用了它,并确保将其分配给所有页面。
在自定义HTML模块中,我插入了以下内容:
{loadposition searchbox}
Run Code Online (Sandbox Code Playgroud)
如您在此处所见-http: //ojospa.webez.net/-它不起作用(请查看右上角)。
为什么不起作用?我仔细检查了所有内容,以确保没有错别字,而且一切看起来都很好。
任何帮助,将不胜感激。
谢谢!
辛西娅
我发展我的第一个Magento的网站谁不希望客户必须登记/结帐时登录的客户端.我该如何选择?
BTW使用Magento v.7.7.0.2
非常感谢,
辛西娅
如果您访问http://digitaldemo.net/anova/并调整浏览器的大小以使其缩小,然后向右水平滚动,您将看到背景现在覆盖了可见屏幕之外的页面部分.
为什么会这样?
非常感激任何的帮助!
最好,
辛西娅
我一直在努力实施跨浏览器圆角的解决方案,即使演示工作在所有的浏览器,当我尝试实现它自己的代码,它在所有浏览器除了 IE8.
这是我的CSS:
body { background:#ffffff url("images/bg.gif") repeat-x ;
font-family:verdana,helvetica,sans-serif ;
font-size:12px ;
color:#000000 ;
margin:0 auto ;
padding:0 ;
}
.clear { clear:both } /* clears floats */
/* #container defines layout width and positioning */
#container { width:1000px ;
margin:auto ;
position:relative ;
z-index:inherit ;
zoom:1 ; /* enables rounded corners in IE6 */
}
#header { width:1000px ;
height:75px ;
padding:10px 0px 10px 0px ;
}
#header-logo { float:left ;
width:255px ;
height:55px ;
background:url("http://template.sophio.com/images/logo.png") no-repeat …
Run Code Online (Sandbox Code Playgroud) 更新:
非常感谢你们对此的帮助.我采取了不同的策略,决定只使用一张桌子.
我有一个由3个表组成的数据库.我有三个简短的表单,我想使用相同的add_player.php将表单数据写入数据库.
根据提交的表单(我在每个表单中都有一个隐藏字段定义form_id),数据将被写入三个表中的一个:ff_offense,ff_kicker,ff_defense.
我收到一个意想不到的错误.我知道我的语法已经关闭,但是我对PHP不够精通,无法发现罪魁祸首.这是add_player.php的代码:
<?php
$con = mysql_connect("localhost","dariia","celtic03");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("football", $con);
if($form_id ="offense") {$query="INSERT INTO ff_offense (ID, PLAYER, POSITION, TEAM, PASS_YDS, RUSH_YDS, REC_YDS, RECEPTIONS, TD)
VALUES ('NULL','$_POST[PLAYER]','$_POST[POSITION]','$_POST[TEAM]','$_POST[PASS_YDS]','$_POST[RUSH_YDS]','$_POST[REC_YDS]','$_POST[RECEPTIONS]','$_POST[TD]')"}
elseif($form_id="kicker") {$query="INSERT INTO ff_kicker {K_ID, K_PLAYER, K_TEAM, K_EXTRA_PTS, K_FG)
VALUES ('NULL','$_POST[K_PLAYER]','$_POST[K_TEAM]','$_POST[K_EXTRA_PTS]','$_POST[K_FG]')"}
elseif($form_id="defense") { $query= "INSERT INTO ff_defense {D_ID, D_TEAM, D_SACKS, D_INT, D_TD}
VALUES ('NULL','$_POST[D_TEAM]','$_POST[D_SACKS]','$_POST[D_INT]','$_POST[D_TD]')"} ;
$db->setQuery($query);
$db->query();
if (!mysql_query($query,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
Run Code Online (Sandbox Code Playgroud)
错误是第11行,这将是VALUES行if($form_id="offense") …
我有一个数据库,通过3种不同的形式写入数据.好消息是表单会写入数据库.坏消息是,每当我点击其中一个表单上的提交按钮时,就会创建一个重复的条目以及第一个条目.
这些表格在http://digitaldemo.net/kickass/test.php上在线.它没有连接到实时数据库,但我想让它在线,以便您可以看到代码.
以下是将表单数据写入数据库的add_player.php代码:
<?php
// contact to database
$connect = mysql_connect("localhost", "dariia", "celtic03") or die ("Error , check your server connection.");
mysql_select_db("football");
// Set up form variables //
//Get data in local variable
$Player=$_POST['Player'];
$Position=$_POST['Position'];
$Team=$_POST['Team'];
// check for null values
$query="INSERT INTO ff_projections(Player, Position, Team) VALUES('$Player','$Position','$Team')";
mysql_query($query) or die(mysql_error());
echo "1 record has been entered.";
mysql_query($query) or die('Error, query failed');
?>
Run Code Online (Sandbox Code Playgroud)