カテゴリー︎: 【WordPress】
wordpressの検索窓に長い文字を入れられて、記事がヒットしてしまうと
デザインが崩れる。。。
なので、いろいろ
search.php をごにょごにょしてみたけど、、、うまくいかんので
単純にinput タグに maxlengthで制限したらあっさり解決した
< input type = "text" value = "" name = "s" id = "s" maxlength = "8" > |
という具合に、 maxlengthを「8」文字に制限したら、デザインも崩れない これでよし!
念の為 wordpressの検索窓のコード全文↓↓↓
< form role = "search" method = "get" id = "searchform" action="<?php echo home_url( '/' ); ?>"> < label class = "screen-reader-text" for = "s" ></ label > < input type = "text" value = "" name = "s" id = "s" maxlength = "8" > < input type = "submit" id = "searchsubmit" value = "記事を検索" > </ form > |