pagination hook doesn’t work with search results

I think your problem with pagination. Use this code and css. <?php function pagination($pages=””, $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == ”) { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo “<div class=\”pagination clearfix\”>”; if($paged > … Read more

WordPress search issue with searching html tags

You could try using several regexps to only search outside angle brackets: function wpse159789_posts_search( $search, $query ) { global $wpdb; if ( ! preg_match( “https://wordpress.stackexchange.com/” . $wpdb->posts . ‘\.post_content LIKE \’%(.+)%\”https://wordpress.stackexchange.com/”, $search, $matches, PREG_OFFSET_CAPTURE ) ) { return $search; } $search_str = stripslashes( $matches[1][0] ); // Cater for closed angle pairs embedded in the search … Read more