【发布时间】:2013-04-14 19:53:17
【问题描述】:
以下是事实:
- Wordpress 主题父级:Pytheas(我使用的是子主题)
- 网站:http://longgame.org
- 我是初学者。我还在学习 CSS 的基础知识。
我的问题:
在首页,有一组五个“亮点”,我将在其中插入文本。请注意下图(描绘了最左边的两个):
黄色高亮表示我似乎无法删除的区域。我做了以下事情:
- 检查 HTML 元素以确认没有意外回车。
- 删除了该内容,下一个项 - “关于”简介“滑过”并表现出相同的行为。
- 搜索我的子主题以确定我是否搞砸了(无疑是问题,但我找不到)。
我不知道这是什么时候开始发生的,但在过去的几天里,我一直在尝试使用 Wordpressy 的所有东西。
正如我所提到的,我是初学者。请让我知道我是否可以提供更多数据以提高纠正此问题的几率。
提前感谢您提供的任何建议。
编辑:我不确定是什么代码,尤其是罪魁祸首,尤其是因为我什至不知道 如何 编辑任何 php 式的东西。我从来没有尝试过。 :)
无论如何,这可能来自父主题?它来自 home-highlights.php - 如果我要离开,请告诉我。
<div class="grid-container clearfix">
<?php
$count=0; //set counter var
foreach($hp_highlight_posts as $post) : setup_postdata($post); //start loop
$count++; //increase counter var with each post in loop
//meta
$hp_highlights_url = get_post_meta($post->ID, 'wpex_hp_highlights_url', TRUE);
$hp_highlights_icon = get_post_meta($post->ID, 'wpex_hp_highlights_icon', TRUE);
?>
<div class="hp-highlight grid-5 <?php echo $post->ID; ?>">
<h3>
<?php
//display icon if option not set to default
if($hp_highlights_icon !='Select') { ?>
<span class="wpex-icon-<?php echo $hp_highlights_icon; ?>"></span>
<?php } //highlight meta option set to "Select" ?>
<?php
//show the highlight title as a link
if(!empty($hp_highlights_url)) { ?><a href="<?php echo $hp_highlights_url; ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php }
//show plain title because link option is blank
else { the_title(); } ?>
</h3>
<?php
//show the post content
the_content(); ?>
感谢您的礼仪反馈。下次我会做得更好。 :)
进一步研究:
【问题讨论】:
-
您忘记发布代码了。生成欢迎网格的代码会很有帮助
-
很抱歉。我真的不知道要使用什么代码。我一直在寻找,会修改这个。
-
您如何添加这些显示在主页上的类别描述?它们是否特定于您正在使用的主题(在主题特定的管理页面中)?一个小部件?页面或帖子上的额外字段?
标签: css wordpress wordpress-theming