0
このコードは画像を左に出力します。私が探しているのは右の画像です:https://s27.postimg.org/niua66jqr/archive.jpg このテーブルを正しく出力するにはどうすればいいですか?アーカイブコードやスタイルコードに問題はありますか?このテーブルを正しく出力するにはどうすればよいですか?
たぶん.archive-container {
margin-top: 85px;
}
.archive-container h2 {
font-weight: normal;
margin-bottom: 30px;
}
.archive,
.year,
th {
font-family: 'Georgia', sans-serif;
font-weight: normal;
color: #a6a6a6;
font-size: 16px;
}
.archive:hover th,
.year:hover th {
color: #a6a6a6 !important;
opacity: 1 !important;
}
.archive a:link:hover {
color: #e69900 !important;
}
a:link {
font-weight: normal;
color: black;
/
}
table {
margin-right: 20px;
border-spacing: 25px 3px;
}
<div class="archive-container">
<h2><?php the_title(); ?></h2>
<script type="text/javascript">
var domainroot = "sitetitle.com"
function Gsitesearch(curobj) {
curobj.q.value = "site:" + domainroot + " " + curobj.qfront.value
}
</script>
<form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)">
<p class="search">Search:
<br />
<input name="q" type="hidden" class="texta" />
<input name="qfront" type="text" style="width: 186px; text-size: 12px; height: 14px;" />
</p>
</form>
<table id=arc>
<?php $query="SELECT YEAR(post_date) AS `year`, MONTH(post_date) as `month`, DAYOFMONTH(post_date) as `dayofmonth`, ID, post_name, post_title FROM $wpdb->posts WHERE post_type = 'article' AND post_status = 'publish' ORDER BY post_date DESC" ; $key=m d5($query);
$cache=w p_cache_get('mp_archives' , 'general'); if (!isset($cache[ $key ])) { $arcresults=$ wpdb->get_results($query); $cache[ $key ] = $arcresults; wp_cache_add('mp_archives', $cache, 'general'); } else { $arcresults = $cache[ $key ]; } if ($arcresults) { $last_year = 0; $last_month = 0; foreach ($arcresults as $arcresult) { $year = $arcresult->year;
$month = $arcresult->month; if ($year != $last_year) { $last_year = $year; $last_month = 0; ?>
<tr class=year>
<th>
<br />
<br />
<?php echo $arcresult->year; ?></th>
</tr>
<?php } if ($month !=$ last_month) { $last_month=$ month; ?>
<tr class=archive>
<th>
<?php echo $wp_locale->get_month($arcresult->month); ?></th>
<td></td>
</tr>
<?php } ?>
<tr class=archive>
<th>
<?php echo $arcresult->dayofmonth; ?></th>
<td id=p<?php echo $arcresult->ID; ?>>
<a href="/<?php echo $arcresult->post_name; ?>">
<?php echo strip_tags(apply_filters('the_title', $arcresult->post_title)); ?></a>
</td>
</tr>
<?php } } ?>
</table>
</div>
<!-- /end .container -->
あなたのPHPスクリプトを送信HTMLのいくつか....代わりにスクリプト –
'> \t
\t \t <メタ文字コード= "@ GCyrillus - これはあなたの話ですか? – Alexander