php - Wordpress search results look wierd with custom theme

one text

Solution:

WordPress gives different classes to <body> for a different pages via body_class() function. One of them is 'search'. I guess you applied this class to a seachform or something like this.

This come from style.css line 460 -

display: flex;
max-width: 500px;

Just rename searchform class to avoid such behavior or try

.search:not(body) {
    // css goes here
}

Source