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

Minor changes and increase readability. #648

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 4 additions & 9 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@
);

// phpcs:ignore -- Title escaped in output.
echo apply_filters(
'generate_comments_title_output',
sprintf(
'<h2 class="comments-title">%s</h2>',
esc_html( $comments_title )
),
$comments_title,
$comments_number
echo sprintf(
'<h2 class="comments-title">%s</h2>',
esc_html( apply_filters( 'generate_comments_title_output', $comments_title, $comments_number ) )
);

/**
Expand Down Expand Up @@ -124,7 +119,7 @@
<?php
endif;

comment_form();
comment_form( apply_filters( 'generate_comment_form_args', array() ) );
?>

</div><!-- #comments -->
6 changes: 4 additions & 2 deletions content.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@

wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
'before' => '<div class="page-links" role="navigation" aria-label="' . esc_attr__( 'Page Navigation', 'generatepress' ) . '">' . esc_html__( 'Pages:', 'generatepress' ),
'after' => '</div>',
'link_before' => '<span class="page-link-item">',
'link_after' => '</span>',
)
);
?>
Expand Down
13 changes: 4 additions & 9 deletions inc/theme-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@ function generate_get_layout() {

if ( is_single() ) {
$layout = generate_get_option( 'single_layout_setting' );
}

if ( is_singular() ) {
} elseif ( is_singular() ) {
$layout_meta = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true );

if ( $layout_meta ) {
$layout = $layout_meta;
}
}

if ( is_home() || is_archive() || is_search() || is_tax() ) {
$layout = $layout_meta ?: $layout;

} elseif ( is_home() || is_archive() || is_search() || is_tax() ) {
$layout = generate_get_option( 'blog_layout_setting' );
}

Expand Down
20 changes: 15 additions & 5 deletions no-results.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
?>

<div class="no-results not-found">
<div class="no-results not-found" role="alert" aria-live="polite">
<div class="inside-article">
<?php
/**
Expand Down Expand Up @@ -53,13 +53,23 @@
</p>

<?php elseif ( is_search() ) : ?>

<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'generatepress' ); ?></p>
<?php
$nothing_found_search = apply_filters(
'generate_search_not_found',
__( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'generatepress' )
);
?>
<p><?php echo esc_html( $nothing_found_search ); ?></p>
<?php get_search_form(); ?>

<?php else : ?>

<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'generatepress' ); ?></p>
<?php
$nothing_found_other = apply_filters(
'generate_other_not_found',
__( 'It seems we can&rsquo;t find what you’re looking for. Perhaps searching can help.', 'generatepress' )
);
?>
<p><?php echo esc_html( $nothing_found_other ); ?></p>
<?php get_search_form(); ?>

<?php endif; ?>
Expand Down