【发布时间】:2013-09-28 02:13:59
【问题描述】:
我将我的 css 和 html 设置为在我的网站右侧栏上居中对齐。 但是,当我加载博客时,它也会加载与主题相关的 css 它正在将我的图像移动到右侧边栏的左侧。
在这里现场观看:http://www.edvizenor.com/?p=blog&id=102
我怎样才能修复图像,使它们在我不向左对齐时 加载博客内容。
如果你点击上面的其他链接可以看到图片然后转到中心 再次。
我的 css 从这样的链接加载:
<link href="css/main.css" rel="stylesheet" type="text/css" />
我的 Wordpress 内容从下面的代码中加载。但我不知道 它如何在主题中包含自己的 CSS。我没有办法展示 这段代码,因为我不知道它是如何加载的。我只能展示我如何加载 wordpress 内容 它是这样完成的:
<?
if(!$_GET[id])
{
$posts = get_posts();
foreach ($posts as $post) : start_wp(); ?>
<br />
<table width="100%" cellpadding="0" cellspacing="0" id="blogHolder" name="blogHolder" >
<tr>
<td width="21%" rowspan="2" align="center" valign="middle">
<div class="blogImage"><a href="http://www.EdVizenor.com/?p=blogContent&id=<? echo get_the_ID(); ?>"><? echo get_the_post_thumbnail($recent["ID"], array(133,133) ); ?></a></div>
<div class="blogDate">
<table width="217" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="76"><? echo the_date();?></td>
</tr>
</table>
</div>
<img src="http://www.TimStaples.com/images/blogImageBox.png" width="177" height="177" /></td>
<td width="79%" height="27" valign="middle" class="blogTitle"><? echo the_title(); ?></td>
</tr>
<tr>
<td valign="top" background="http://www.TimStaples.com/images/blogBG2.png"><div class="blogContent">
<? echo the_excerpt(); ?>
<div class="readMore"><a href="http://www.EdVizenor.com/?p=blogContent&id=<? echo get_the_ID(); ?>"><img src="http://www.TimStaples.com/images/readMore.png" width="142" height="32" alt="Read More" /></a> </div>
</div></td>
</tr>
<tr>
</tr>
</table>
<p>
<?php
endforeach;
}
if($_GET[id])
{
$posts = get_posts('p=' . $_GET[id] .'');
foreach ($posts as $post) : start_wp(); ?>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="right"><?php the_date(); ?></td>
</tr>
<tr>
<td valign="middle" class="blogTitlePrint"><br />
<?php the_title(); ?>
<hr /></td>
</tr>
<tr>
<td><?php the_content(); ?></td>
</tr>
</table>
<br />
<?php
endforeach;
}
?>
【问题讨论】:
-
有关您编写的代码问题的问题必须在问题本身中描述具体问题——并包含重现问题的有效代码。有关指导,请参见 SSCCE.org。 (但我没有 -1,因为它仍然描述得很好!)