Skip to content

Commit

Permalink
Merge pull request #90 from OpenSourceOrg/add/50-event-page-updates
Browse files Browse the repository at this point in the history
Event page updates
  • Loading branch information
bernattorras authored Jun 7, 2024
2 parents ac7dcfd + 72f7de8 commit 09f69df
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 17 deletions.
8 changes: 6 additions & 2 deletions themes/osi/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
if ( have_posts() ) :
?>
<section class="content--page" id="content-page">
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>
<?php
<?php
if ( 'event' === get_post_type() ) {
get_template_part( 'template-parts/breadcrumbs-sc_event' );
} else {
get_template_part( 'template-parts/breadcrumbs' );
}
$count = 0;
/* Start the Loop */
while ( have_posts() ) :
Expand Down
7 changes: 5 additions & 2 deletions themes/osi/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
<main class="content--body <?php echo esc_attr( osi_main_class() ); ?>" role="main">

<section class="content--page" id="content-page">
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>

<?php
if ( 'event' === get_post_type() ) {
get_template_part( 'template-parts/breadcrumbs-sc_event' );
} else {
get_template_part( 'template-parts/breadcrumbs' );
}
while ( have_posts() ) :
the_post();

Expand Down
8 changes: 6 additions & 2 deletions themes/osi/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

<main class="content--body <?php echo esc_attr( osi_main_class() ); ?>" role="main">
<section class="content--page" id="content-page">
<?php get_template_part( 'template-parts/breadcrumbs' ); ?>

<?php
if ( 'event' === get_post_type() ) {
get_template_part( 'template-parts/breadcrumbs-sc_event' );
} else {
get_template_part( 'template-parts/breadcrumbs' );
}

while ( have_posts() ) :
the_post();

Expand Down
13 changes: 10 additions & 3 deletions themes/osi/template-parts/breadcrumbs-sc_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
<nav class="entry-breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList">
<span itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
<meta itemprop="position" content="1">
<meta itemprop="position" content="0">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="home-link" itemprop="item" rel="home">
<span itemprop="name"><?php echo esc_html__( 'Home', 'osi' ); ?></span>
</a>
</span>
<span itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
<meta itemprop="position" content="2">
<a href="<?php echo esc_url( home_url( '/events/' ) ); ?>" class="events-link" itemprop="item">
<span itemprop="name"><?php echo esc_html__( 'Events', 'osi' ); ?></span>
</a>
</span>
<?php if ( is_single() && get_post_type() == 'event' ) : ?>
<span class="current-page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem">
<meta itemprop="position" content="1">
<span itemprop="name"><?php echo esc_html__( 'Events', 'osi' ); ?></span>
<meta itemprop="position" content="3">
<span itemprop="name"><?php echo esc_html( get_the_title() ); ?></span>
</span>
<?php endif; ?>
</nav>
</div><!-- .wrapper -->
</div><!-- .breadcrumb-area -->
15 changes: 7 additions & 8 deletions themes/osi/template-parts/header-featured-image.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

if ( function_exists( 'Sugar_Calendar\AddOn\Ticketing\Settings\get_setting' ) ) {
$recepit_page_id = Sugar_Calendar\AddOn\Ticketing\Settings\get_setting( 'receipt_page' );

Expand All @@ -14,29 +13,29 @@

?>

<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) : ?>
<?php if ( has_post_thumbnail() && 'post' !== get_post_type( $post ) ) { ?>
<header class="entry-header cover--header">
<div class="wp-block-cover alignfull">
<img class="wp-block-cover__image-background" alt="" src="<?php the_post_thumbnail_url(); ?>" data-object-fit="cover"/>
<div class="wp-block-cover__inner-container">
</div>
</div>
</header>
<?php elseif ( is_page() ) : ?>
<?php } elseif ( ! has_post_thumbnail() && ! in_array( get_post_type( $post ), array( 'post', 'event', 'page' ), true ) ) { ?>
<header class="entry-header cover--header no-thumbnail">
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
<div class="wp-block-cover alignfull">
<div class="wp-block-cover__inner-container">
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
<?php osi_the_page_dates(); ?>
</div>
</div>
</header>
<?php else : ?>
<?php } elseif ( is_page() ) { ?>
<header class="entry-header cover--header no-thumbnail">
<div class="wp-block-cover alignfull">
<div class="wp-block-cover alignfull has-neutral-dark-background-color has-background-dim-100 has-background-dim">
<div class="wp-block-cover__inner-container">
<?php echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
<?php osi_the_page_dates(); ?>
</div>
</div>
</header>
<?php endif; ?>
<?php } ?>

0 comments on commit 09f69df

Please sign in to comment.