Site logo

[Support request] Replace content on NO Results Page

Home Forums Support [Support request] Replace content on NO Results Page

Home Forums Support Replace content on NO Results Page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2350373
    Tesco

    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>

    #2350870
    Ying
    Staff
    Customer Support

    Hi there,

    You can use a block element - content template: https://docs.generatepress.com/article/block-element-content-template/

    Choose No search results as the element’s location.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.