• Resolved nownomi

    (@nownomi)


    Hi there,

    I’ve been trying to build on top of the single.php template with an if loop that uses
    attachment.php when directed from permalink with media attached, which then uses content_none.php to display get_search_form().

    I’ve tried to remove get_search_form() and related <h2>,<p> tags from the body of an attachment.php with an if/ else statement, which only displays if loop and the "Nothing Found... It seems we can't find what you're looking for. Perhaps searching can help." <p> tag and search form or just the if loop and no single.php template.

    The single.php template is important because it is being used to display the media attachment (audio, video, and images) above the if loop I mentioned above.

    I’ve also tried to remove_action( 'wp_body_open', get_search_form() ); in an if loop, however that gives me duplicate get_search_form… which lead in search for an Exs-News wp_body_open hook, which I am unable to find under parent theme (Exs).

    Is there a exs-news body hook?
    or is another way to remove content_none.php get_search_form() and related elements?

Viewing 1 replies (of 1 total)
  • Theme Author exstheme

    (@exstheme)

    Hello, @nownomi !

    Thank you for using our theme!
    Sorry, it is not very clear for me what exactly you want to achieve.
    You can just override your ‘template-parts/content-none.php’ file into your child theme from the parent theme. You can add more conditions there to hide your search form and ‘not found’ text from your template file.
    There is no any action to add search form into your template file.

    Please let me know if that is what you’re looking for.

    Best regards!

Viewing 1 replies (of 1 total)
  • The topic ‘How to remove attachment.php body get_search_form() ?’ is closed to new replies.