Site logo

Archived topic

Replace content on NO Results Page

1 reply · Started by Tesco on September 22, 2022

Viewing posts 1–2 of 2

Is there a way to replace the (PHP) content (inside <div class="entry-content">) on the no-results.php page with some Hook OR Filter but without any plugins OR a custom page template?

This is the content I would like to customize:

<div class="entry-content">

`<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>

<p>
<?php
printf(
/* translators: 1: Admin URL */
__( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'generatepress' ),
esc_url( admin_url( 'post-new.php' ) )
);
?>
</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 get_search_form(); ?>

<?php else : ?>

<p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'generatepress' ); ?></p>
<?php get_search_form(); ?>

<?php endif; ?>`

</div>

This archived topic is closed to new replies.