Edit File by line
/home/barbar84/public_h.../wp-conte.../themes/twentytw...
File: index.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The main template file
[2] Fix | Delete
*
[3] Fix | Delete
* This is the most generic template file in a WordPress theme
[4] Fix | Delete
* and one of the two required files for a theme (the other being style.css).
[5] Fix | Delete
* It is used to display a page when nothing more specific matches a query.
[6] Fix | Delete
* E.g., it puts together the home page when no home.php file exists.
[7] Fix | Delete
*
[8] Fix | Delete
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
[9] Fix | Delete
*
[10] Fix | Delete
* @package WordPress
[11] Fix | Delete
* @subpackage Twenty_Twenty
[12] Fix | Delete
* @since Twenty Twenty 1.0
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
get_header();
[16] Fix | Delete
?>
[17] Fix | Delete
[18] Fix | Delete
<main id="site-content" role="main">
[19] Fix | Delete
[20] Fix | Delete
<?php
[21] Fix | Delete
[22] Fix | Delete
$archive_title = '';
[23] Fix | Delete
$archive_subtitle = '';
[24] Fix | Delete
[25] Fix | Delete
if ( is_search() ) {
[26] Fix | Delete
global $wp_query;
[27] Fix | Delete
[28] Fix | Delete
$archive_title = sprintf(
[29] Fix | Delete
'%1$s %2$s',
[30] Fix | Delete
'<span class="color-accent">' . __( 'Search:', 'twentytwenty' ) . '</span>',
[31] Fix | Delete
'&ldquo;' . get_search_query() . '&rdquo;'
[32] Fix | Delete
);
[33] Fix | Delete
[34] Fix | Delete
if ( $wp_query->found_posts ) {
[35] Fix | Delete
$archive_subtitle = sprintf(
[36] Fix | Delete
/* translators: %s: Number of search results. */
[37] Fix | Delete
_n(
[38] Fix | Delete
'We found %s result for your search.',
[39] Fix | Delete
'We found %s results for your search.',
[40] Fix | Delete
$wp_query->found_posts,
[41] Fix | Delete
'twentytwenty'
[42] Fix | Delete
),
[43] Fix | Delete
number_format_i18n( $wp_query->found_posts )
[44] Fix | Delete
);
[45] Fix | Delete
} else {
[46] Fix | Delete
$archive_subtitle = __( 'We could not find any results for your search. You can give it another try through the search form below.', 'twentytwenty' );
[47] Fix | Delete
}
[48] Fix | Delete
} elseif ( is_archive() && ! have_posts() ) {
[49] Fix | Delete
$archive_title = __( 'Nothing Found', 'twentytwenty' );
[50] Fix | Delete
} elseif ( ! is_home() ) {
[51] Fix | Delete
$archive_title = get_the_archive_title();
[52] Fix | Delete
$archive_subtitle = get_the_archive_description();
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
if ( $archive_title || $archive_subtitle ) {
[56] Fix | Delete
?>
[57] Fix | Delete
[58] Fix | Delete
<header class="archive-header has-text-align-center header-footer-group">
[59] Fix | Delete
[60] Fix | Delete
<div class="archive-header-inner section-inner medium">
[61] Fix | Delete
[62] Fix | Delete
<?php if ( $archive_title ) { ?>
[63] Fix | Delete
<h1 class="archive-title"><?php echo wp_kses_post( $archive_title ); ?></h1>
[64] Fix | Delete
<?php } ?>
[65] Fix | Delete
[66] Fix | Delete
<?php if ( $archive_subtitle ) { ?>
[67] Fix | Delete
<div class="archive-subtitle section-inner thin max-percentage intro-text"><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?></div>
[68] Fix | Delete
<?php } ?>
[69] Fix | Delete
[70] Fix | Delete
</div><!-- .archive-header-inner -->
[71] Fix | Delete
[72] Fix | Delete
</header><!-- .archive-header -->
[73] Fix | Delete
[74] Fix | Delete
<?php
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
if ( have_posts() ) {
[78] Fix | Delete
[79] Fix | Delete
$i = 0;
[80] Fix | Delete
[81] Fix | Delete
while ( have_posts() ) {
[82] Fix | Delete
$i++;
[83] Fix | Delete
if ( $i > 1 ) {
[84] Fix | Delete
echo '<hr class="post-separator styled-separator is-style-wide section-inner" aria-hidden="true" />';
[85] Fix | Delete
}
[86] Fix | Delete
the_post();
[87] Fix | Delete
[88] Fix | Delete
get_template_part( 'template-parts/content', get_post_type() );
[89] Fix | Delete
[90] Fix | Delete
}
[91] Fix | Delete
} elseif ( is_search() ) {
[92] Fix | Delete
?>
[93] Fix | Delete
[94] Fix | Delete
<div class="no-search-results-form section-inner thin">
[95] Fix | Delete
[96] Fix | Delete
<?php
[97] Fix | Delete
get_search_form(
[98] Fix | Delete
array(
[99] Fix | Delete
'label' => __( 'search again', 'twentytwenty' ),
[100] Fix | Delete
)
[101] Fix | Delete
);
[102] Fix | Delete
?>
[103] Fix | Delete
[104] Fix | Delete
</div><!-- .no-search-results -->
[105] Fix | Delete
[106] Fix | Delete
<?php
[107] Fix | Delete
}
[108] Fix | Delete
?>
[109] Fix | Delete
[110] Fix | Delete
<?php get_template_part( 'template-parts/pagination' ); ?>
[111] Fix | Delete
[112] Fix | Delete
</main><!-- #site-content -->
[113] Fix | Delete
[114] Fix | Delete
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>
[115] Fix | Delete
[116] Fix | Delete
<?php
[117] Fix | Delete
get_footer();
[118] Fix | Delete
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function