Skip to content

Commit 09f69df

Browse files
authored
Merge pull request #90 from OpenSourceOrg/add/50-event-page-updates
Event page updates
2 parents ac7dcfd + 72f7de8 commit 09f69df

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

themes/osi/index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
if ( have_posts() ) :
2323
?>
2424
<section class="content--page" id="content-page">
25-
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>
26-
<?php
25+
<?php
26+
if ( 'event' === get_post_type() ) {
27+
get_template_part( 'template-parts/breadcrumbs-sc_event' );
28+
} else {
29+
get_template_part( 'template-parts/breadcrumbs' );
30+
}
2731
$count = 0;
2832
/* Start the Loop */
2933
while ( have_posts() ) :

themes/osi/page.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
<main class="content--body <?php echo esc_attr( osi_main_class() ); ?>" role="main">
2020

2121
<section class="content--page" id="content-page">
22-
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>
23-
2422
<?php
23+
if ( 'event' === get_post_type() ) {
24+
get_template_part( 'template-parts/breadcrumbs-sc_event' );
25+
} else {
26+
get_template_part( 'template-parts/breadcrumbs' );
27+
}
2528
while ( have_posts() ) :
2629
the_post();
2730

themes/osi/single.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313

1414
<main class="content--body <?php echo esc_attr( osi_main_class() ); ?>" role="main">
1515
<section class="content--page" id="content-page">
16-
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>
17-
1816
<?php
17+
if ( 'event' === get_post_type() ) {
18+
get_template_part( 'template-parts/breadcrumbs-sc_event' );
19+
} else {
20+
get_template_part( 'template-parts/breadcrumbs' );
21+
}
22+
1923
while ( have_posts() ) :
2024
the_post();
2125

themes/osi/template-parts/breadcrumbs-sc_event.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
<nav class="entry-breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList">
44
<span itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
55
<meta itemprop="position" content="1">
6-
<meta itemprop="position" content="0">
76
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="home-link" itemprop="item" rel="home">
87
<span itemprop="name"><?php echo esc_html__( 'Home', 'osi' ); ?></span>
98
</a>
109
</span>
10+
<span itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
11+
<meta itemprop="position" content="2">
12+
<a href="<?php echo esc_url( home_url( '/events/' ) ); ?>" class="events-link" itemprop="item">
13+
<span itemprop="name"><?php echo esc_html__( 'Events', 'osi' ); ?></span>
14+
</a>
15+
</span>
16+
<?php if ( is_single() && get_post_type() == 'event' ) : ?>
1117
<span class="current-page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
12-
<meta itemprop="position" content="1">
13-
<span itemprop="name"><?php echo esc_html__( 'Events', 'osi' ); ?></span>
18+
<meta itemprop="position" content="3">
19+
<span itemprop="name"><?php echo esc_html( get_the_title() ); ?></span>
1420
</span>
21+
<?php endif; ?>
1522
</nav>
1623
</div><!-- .wrapper -->
1724
</div><!-- .breadcrumb-area -->
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
if ( function_exists( 'Sugar_Calendar\AddOn\Ticketing\Settings\get_setting' ) ) {
43
$recepit_page_id = Sugar_Calendar\AddOn\Ticketing\Settings\get_setting( 'receipt_page' );
54

@@ -14,29 +13,29 @@
1413

1514
?>
1615

17-
<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) : ?>
16+
<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) { ?>
1817
<header class="entry-header cover--header">
1918
<div class="wp-block-cover alignfull">
2019
<img class="wp-block-cover__image-background" alt="" src="<?php the_post_thumbnail_url(); ?>" data-object-fit="cover"/>
2120
<div class="wp-block-cover__inner-container">
2221
</div>
2322
</div>
2423
</header>
25-
<?php elseif ( is_page() ) : ?>
24+
<?php } elseif ( ! has_post_thumbnail() && ! in_array( get_post_type( $post ), array( 'post', 'event', 'page' ), true ) ) { ?>
2625
<header class="entry-header cover--header no-thumbnail">
27-
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
26+
<div class="wp-block-cover alignfull">
2827
<div class="wp-block-cover__inner-container">
29-
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
3028
<?php osi_the_page_dates(); ?>
3129
</div>
3230
</div>
3331
</header>
34-
<?php else : ?>
32+
<?php } elseif ( is_page() ) { ?>
3533
<header class="entry-header cover--header no-thumbnail">
36-
<div class="wp-block-cover alignfull">
34+
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
3735
<div class="wp-block-cover__inner-container">
36+
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
3837
<?php osi_the_page_dates(); ?>
3938
</div>
4039
</div>
4140
</header>
42-
<?php endif; ?>
41+
<?php } ?>

0 commit comments

Comments
 (0)