WordPressで動画ポータルサイトの構築を行っています。
現在、トップページのデザインをスマートにするために、最初のビューではサムネイルのみが出現しているようなレイアウトにし、マウスオーバーしてはじめて、titleや任意のHTMLタグを付与したテキストが表示されるような仕様にできればと思っています。
#現在のトップページ
PHP
1<?php get_header(); ?> 2 3 4<div id="page"> 5 <div class="content"> 6 <article class="article"> 7 <div id="content_box"> 8 <h3>NEW </h3> 9 <div class="map"> 10 <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 11 12 <div class="post excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"> 13 <header> 14 <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="featured-thumbnail"> 15 <?php if ( has_post_thumbnail() ) { ?> 16 <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('homepage',array('title' => '')); echo '</div>'; ?> 17 <?php } else { ?> 18 <div class="featured-thumbnail"> 19 <img width="200" height="110" src="<?php echo get_template_directory_uri(); ?>/images/nothumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>"> 20 </div> 21 <?php } ?> 22 </a> 23 <h2 class="title"> 24 <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a> 25 </h2> 26 </header><!--.header--> 27 <?php $matches = null; 28 preg_match('#<span[^>]*>(.*)</span>#', get_the_content(), $matches); 29 echo $matches[1]; ?> 30 <div class="readMore"><div class="background"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php _e('インタビューを見る','mythemeshop'); ?></a></div></div> 31 32 </div><!--.post excerpt--> 33 <?php endwhile; else: ?> 34 <div class="post excerpt"> 35 <div class="no-results"> 36 <p><strong><?php _e('There has been an error.', 'mythemeshop'); ?></strong></p> 37 <p><?php _e('We apologize for any inconvenience, please hit back on your browser or use the search form below.', 'mythemeshop'); ?></p> 38 <?php get_search_form(); ?> 39 </div><!--noResults--> 40 </div> 41 <?php endif; ?> 42 <?php if ($options['mts_pagenavigation'] == '1') { ?> 43 <?php pagination($additional_loop->max_num_pages);?> 44 <?php } else { ?> 45 <div class="pnavigation2"> 46 <div class="nav-previous"><?php next_posts_link( __( '← '.'Older posts', 'mythemeshop' ) ); ?></div> 47 <div class="nav-next"><?php previous_posts_link( __( 'Newer posts'.' →', 'mythemeshop' ) ); ?></div> 48 </div> 49 <?php } ?> 50 </div> 51 </div> 52 </article> 53 54<?php get_footer(); ?>
#参考サイト
http://bunkai-kei.com/
このサイトのような挙動ができればと思っています。
もし、実装の経験がある方がいましたら、ぜひアドバイスお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。