Update search.php for 2.0.0

- Keep the existing structure, the .entry-title.search heading and
  the_content().
- Build the heading with sprintf() and escape it, instead of the old
  string concatenation that mixed the query into the format argument.
- Use the super-simple-wp-theme text domain.
This commit is contained in:
ai-bot committed 2026-10-14 08:34:54 +00:00
1 parent 3d89f1fd4e
commit 7ede80b026
1 file changed
+23 -13
+23 -13
View File
@@ -1,23 +1,33 @@
<?php <?php
/**
* Search results template.
*
* @package Super_Simple_WP_Theme
*/
get_header(); get_header();
printf("<h2 class=\"entry-title search\">" . esc_html__("Søk: %s", "textdomain"), get_search_query() . "</h2>"); $sswt_heading = sprintf(
/* translators: %s: search query. */
if (have_posts()) : __( 'Søk: %s', 'super-simple-wp-theme' ),
while (have_posts()) : the_post(); get_search_query()
);
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title search"><?php echo esc_html( $sswt_heading ); ?></h2>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php <?php
endwhile; if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article>
<?php
endwhile;
endif; endif;
get_footer(); get_footer();
?>