|
| 1 | +<?php |
| 2 | +// テーマオプションを取得 |
| 3 | +$options = get_desing_plus_option(); |
| 4 | + |
| 5 | +if ( $options['footer_bar_display'] == 'type1' || $options['footer_bar_display'] == 'type2' ) : |
| 6 | + // ページタイトルを取得 |
| 7 | + $title = wp_title( '|', false, 'right' ); |
| 8 | + |
| 9 | + // ページ URL を取得 |
| 10 | + $url = ( empty( $_SERVER['HTTPS'] ) ? 'http://' : 'https://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
| 11 | + |
| 12 | + $footer_bar_btn_classes = array(); |
| 13 | + $footer_bar_btn_target = ''; |
| 14 | + $footer_bar_btn_url = ''; |
| 15 | +?> |
| 16 | +<ul class="dp-footer-bar"> |
| 17 | +<?php |
| 18 | + // ボタンを表示 |
| 19 | + foreach ( $options['footer_bar_btns'] as $key => $value ) : |
| 20 | + switch ( $value['type'] ) { |
| 21 | + // ボタンタイプ:デフォルト |
| 22 | + case 'type1' : |
| 23 | + $footer_bar_btn_classes = array( 'dp-footer-bar-item' ); |
| 24 | + $footer_bar_btn_target = $value['target']; |
| 25 | + $footer_bar_btn_url = $value['url']; |
| 26 | + break; |
| 27 | + // ボタンタイプ:シェア |
| 28 | + case 'type2' : |
| 29 | + $footer_bar_btn_classes = array( 'dp-footer-bar-share', 'dp-footer-bar-item' ); |
| 30 | + $footer_bar_btn_url = '#'; |
| 31 | + break; |
| 32 | + // ボタンタイプ:電話番号 |
| 33 | + case 'type3' : |
| 34 | + $footer_bar_btn_classes = array( 'dp-footer-bar-item' ); |
| 35 | + $footer_bar_btn_url = 'tel:' . $value['number']; |
| 36 | + } |
| 37 | +?> |
| 38 | + <li class="<?php echo esc_attr( implode( ' ', $footer_bar_btn_classes ) ); ?>"> |
| 39 | + <a href="<?php echo esc_url( $footer_bar_btn_url ); ?>"<?php echo $footer_bar_btn_target ? ' target="_blank"' : ''; ?>> |
| 40 | + <span class="dp-footer-bar-icon icon-<?php echo esc_attr( $value['icon'] ); ?>"><?php echo esc_html( $value['label'] ); ?></span> |
| 41 | + </a> |
| 42 | + </li> |
| 43 | +<?php |
| 44 | + endforeach; |
| 45 | +?> |
| 46 | +</ul> |
| 47 | +<div id="modal-overlay" class="modal-overlay hide"> |
| 48 | + <div class="modal-close icon-close"></div> |
| 49 | +</div> |
| 50 | +<div id="modal-content" class="modal-content hide"> |
| 51 | + <ul class="share clearfix"> |
| 52 | + <li class="share-button share-button--rounded-square"> |
| 53 | + <a href="https://twitter.com/intent/tweet?url=<?php echo $url; ?>&text=<?php echo $title; ?>" onClick="window.open(encodeURI(decodeURI(this.href)), 'tweetwindow', 'width=650, height=470, personalbar=0, toolbar=0, scrollbars=1, sizable=1'); return false;"><img src="<?php echo get_template_directory_uri(); ?>/img/common/twitter.png" alt=""></a> |
| 54 | + </li> |
| 55 | + <li class="share-button"> |
| 56 | + <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo rawurlencode( $url ); ?>"><img src="<?php echo get_template_directory_uri(); ?>/img/common/facebook.png" alt=""></a> |
| 57 | + </li> |
| 58 | + <li class="share-button"> |
| 59 | + <a href="http://line.me/R/msg/text/?<?php echo rawurlencode( $title ); ?><?php echo rawurlencode( $url ); ?>"><img src="<?php echo get_template_directory_uri(); ?>/img/common/line.png" alt=""></a> |
| 60 | + </li> |
| 61 | + <li class="share-button"> |
| 62 | + <a href="http://b.hatena.ne.jp/entry/" class="hatena-bookmark-button" data-hatena-bookmark-layout="touch" data-hatena-bookmark-width="50" data-hatena-bookmark-height="50" title="このエントリーをはてなブックマークに追加"><img src="https://b.st-hatena.com/images/entry-button/ [email protected]" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="https://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script> |
| 63 | + </li> |
| 64 | + </ul> |
| 65 | +</div> |
| 66 | +<?php |
| 67 | +endif; |
| 68 | +?> |
0 commit comments