Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/blog import #52

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion themes/osi/assets/scss/_6_components.content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ p, h1, h2, h3, h4, h5, h6, blockquote, ol, ul, dl, address {

.single-post .cover--header {
&.no-thumbnail {
min-height: 430px;
min-height: 305px;
}
}

Expand Down
9 changes: 6 additions & 3 deletions themes/osi/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,13 @@ function register_footer_above_sidebar() {
}
add_action( 'widgets_init', 'register_footer_above_sidebar' );

// these two functions adjust the 'news' (post archive) to show 1 fewer posts on the first page, for symmetry
/**
* Adjust the 'news' (post archive) to show 1 fewer posts on the first page, for symmetry
*/

add_action( 'pre_get_posts', 'osi_query_offset', 1 );
function osi_query_offset( &$query ) {
if ( ! ( $query->is_blog() || is_main_query() ) ) {
if ( ! ( $query->is_blog() || is_main_query() ) || is_admin() ) {
return;
}

Expand All @@ -356,7 +359,7 @@ function osi_query_offset( &$query ) {
add_filter( 'found_posts', 'osi_adjust_offset_pagination', 1, 2 );
function osi_adjust_offset_pagination( $found_posts, $query ) {
$offset = -1;
if ( $query->is_blog() && is_main_query() ) {
if ( $query->is_blog() && is_main_query() && ! is_admin() ) {
return $found_posts - $offset;
}
return $found_posts;
Expand Down
5 changes: 0 additions & 5 deletions themes/osi/inc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ function osi_excerpt_length( $length ) {
}

function osi_excerpt_more( $more ) {

if ( is_post_type_archive( sugar_calendar_get_event_post_type_id() ) ) {
return '...';
}

return '... <a class="read-more" href="' . get_permalink( get_the_ID() ) . '">' . __( 'Read More', 'osi' ) . '</a>';
}
add_filter( 'excerpt_length', 'osi_excerpt_length' );
add_filter( 'excerpt_more', 'osi_excerpt_more' );
Expand Down
2 changes: 1 addition & 1 deletion themes/osi/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
get_template_part( 'template-parts/content', get_post_type() );

//If comments are open or we have at least one comment, load up the comment template.
if ( 'board-member' === get_post_type() ) :
if ( 'board-member' === get_post_type() || 'post' === get_post_type() ) :
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
Expand Down
2 changes: 1 addition & 1 deletion themes/osi/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/osi/template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div><!-- .entry-content -->
<section id="pre-footer">
<?php get_template_part( 'template-parts/nav-postname-pager' ); ?>
<?php //get_template_part( 'template-parts/email-block' ); ?>
<?php get_template_part( 'template-parts/email-block' ); ?>
</section>

</article><!-- #post-<?php the_ID(); ?> -->
4 changes: 2 additions & 2 deletions themes/osi/template-parts/email-block.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// You can edit reusable blocks by going to /wp-admin/edit.php?post_type=wp_block
$email_block = get_page_by_title( 'Email Signup Form Block', OBJECT, 'wp_block' );
if($email_block) {
if ( $email_block ) {
echo apply_filters( 'the_content', $email_block->post_content );
}
6 changes: 3 additions & 3 deletions themes/osi/template-parts/header-featured-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

?>

<?php if ( has_post_thumbnail() ) : ?>
<?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"/>
Expand All @@ -25,9 +25,9 @@
</header>
<?php else : ?>
<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 // echo ( ! empty( $page_title ) ) ? '<h1 class="entry-title page--title">' . esc_html( $page_title ) . '</h1>' : ''; ?>
<?php osi_the_page_dates(); ?>
</div>
</div>
Expand Down
Loading