LoginSignup
0
0

More than 3 years have passed since last update.

WordPressのThe Events Calendar プラグインの住所の並び方を変更

Last updated at Posted at 2020-08-09

<?php ?>ブロックの順番を変えるだけ。ついでに国名表示は消す。

address.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
        die( '-1' );
}

$venue_id = get_the_ID();

$full_region = tribe_get_full_region( $venue_id );

?>
<span class="tribe-address">

<!-- 郵便番号 -->
<?php
// This location's postal code.
if ( tribe_get_zip( $venue_id ) ) : ?>
        <span class="tribe-postal-code"><?php echo tribe_get_zip( $venue_id ); ?></span>
<?php endif; ?>

<!-- 都道府県 -->
<?php
// This location's abbreviated region. Full region name in the element title.
if ( tribe_get_region( $venue_id ) ) : ?>
        <abbr class="tribe-region tribe-events-abbr" title="<?php esc_attr_e( $full_region ); ?>"><?php echo tribe_get_region( $venue_id ); ?></abbr>
<?php endif; ?>

<!-- 市町村区 -->
<?php
// This locations's city.
if ( tribe_get_city( $venue_id ) ) :
        if ( tribe_get_address( $venue_id ) ) : ?>
                <br>
        <?php endif; ?>
        <span class="tribe-locality"><?php echo tribe_get_city( $venue_id ); ?></span><span class="tribe-delimiter">,</span>
<?php endif; ?>

<!-- 市町村区よりあと -->
<?php
// This location's street address.
if ( tribe_get_address( $venue_id ) ) : ?>
<span class="tribe-street-address"><?php echo tribe_get_address( $venue_id ); ?></span>
        <?php if ( ! tribe_is_venue() ) : ?>
                <br>
        <?php endif; ?>
<?php endif; ?>


<!-- 国は表示しない
<?php
// This location's country.
if ( tribe_get_country( $venue_id ) ) : ?>
        <span class="tribe-country-name"><?php echo tribe_get_country( $venue_id ); ?></span>
<?php endif; ?>
 -->
</span>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0