0

Bonesの「フレームワーク」をテーマにし始めたばかりです。リンクだけでなく、フロントページの記事のプレビューを投稿にリンクさせたいと思い<h1>ます。

どうすればこれを達成できますか?プレビューリンク全体をクリック可能なdivにしますか?

これがそのセクションのモックアップです!:)

<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">

                            <header class="article-header">

                                <h1 class="h2"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>

                                <p class="byline vcard"><?php _e('Posted', 'bonestheme'); ?> <time class="updated" datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(get_option('date_format')); ?></time> <?php _e('by', 'bonestheme'); ?> <span class="author"><?php the_author_posts_link(); ?></span> <span class="amp">&</span> <?php _e('filed under', 'bonestheme'); ?> <?php the_category(', '); ?>.</p>

                            </header> <!-- end article header -->

                            <section class="entry-content clearfix">
                                <?php the_content(); ?>
                            </section> <!-- end article section -->
4

2 に答える 2

0

HTML5 仕様に準拠しているかどうかはわかりませんが、 を移動してすべての記事をラップすることができます..:

    <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">

<!-- move <a> to here -->

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">

                                <header class="article-header">

                                    <h1 class="h2"><?php the_title(); ?> </h1>

                                    <p class="byline vcard"><?php _e('Posted', 'bonestheme'); ?> <time class="updated" datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(get_option('date_format')); ?></time> <?php _e('by', 'bonestheme'); ?> <span class="author"><?php the_author_posts_link(); ?></span> <span class="amp">&</span> <?php _e('filed under', 'bonestheme'); ?> <?php the_category(', '); ?>.</p>

                                </header> <!-- end article header -->

                                <section class="entry-content clearfix">
                                    <?php the_content(); ?>
                                </section> <!-- end article section -->
<!-- close </a>  here -->
    </a>
于 2012-11-25T07:59:46.213 に答える
0

CSSと組み合わせたJavaScriptソリューションをいつでも使用できます。

<article style="cursor:pointer;" onclick="window.location='<?php the_permalink(); ?>'">
  ...
</article>
于 2012-11-25T00:28:58.647 に答える