为什么不用 WordPress/PHP 来做呢?
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="entry"> <!-- or whatever your loop code is... -->
<?php the_content(); ?>
</div>
<?php if ( $post->ID == "40" ) : ?>
<a href='#anker1'>\f107</a>
<?php endif; ?>
<?php endwhile; else: ?>
编辑以回答有关数组和样式的评论问题。将您关心的 ID 放入数组中$myIDs
。这还将在每个名为“link-##”的名称上输出一个类名,其中## 是帖子 ID 号。
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="entry"> <!-- or whatever your loop code is... -->
<?php the_content(); ?>
</div>
<?php
$myIDs = array(40, 42, 147, 256);
if ( in_array($post->ID, $myIDs) ) : ?>
<a href='#anker1' class="button-link link-<?php the_ID() ?>">\f107</a>
<?php endif; ?>
<?php endwhile; else: ?>
更多信息:
http ://us3.php.net/in_array
http://codex.wordpress.org/Template_Tags
http://codex.wordpress.org/Function_Reference/the_ID