how to prevent the spam on search function?

I’d suggest prohibiting spam users first. But above all, I’m not aware about the performance of the Search Meter plugin. Using free tool like Google Analytics or StatCounter you can verify the searches really occurred or not. Workaround As you have the exact timestamp when the search occurred you can also get the user’s identity, … Read more

Search function not working

Header <form> don’t have action=”” attribute. So basically what form do, when you search, is append s=keyWord in current url, that is why you have url like this https://techcart.pk/product/8mm-led-10pcs/?s=abc. What you need to to is to add action=”” in <form>. You can inspect element in sidebar search field and you can see this markup: <form … Read more

WordPress search page pagination displaying but not functional

Answer provided in the comments: global $wp_query; $big = 999999999; // need an unlikely integer $pagination_args = array( ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))), ‘format’ => ‘?paged=%#%’, ‘current’ => max( 1, get_query_var(‘paged’) ), ‘mid_size’ => 1, ‘total’ => $wp_query->max_num_pages ); if(have_posts()): while(have_posts()): the_post(); //individual search result endwhile; wp_reset_postdata(); echo paginate_links($pagination_args); endif;

how to add navigation icons in specific template?

First add this in function.php file. This is font-awesome cdn function wp_enqueue_icon_stylesheet() { wp_register_style( ‘fontawesome’, ‘http:////maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css’ ); wp_enqueue_style( ‘fontawesome’); } add_action( ‘wp_enqueue_scripts’, ‘wp_enqueue_icon_stylesheet’ ); Then add this class ‘fa fa-lg fa-home’ in specific menu from backend menu Appreance->menus Then select the screen-option from top left and select/check the ‘CSS Classes’ After that put the ‘fa … Read more

Search results are showing full page instead of sample

Go to theme settings in dashboard (Pokemon -> Layout) and set option “Cut content on the Front/Category page” to ON. Update #1 To change the way posts are displayed only on the search page, you can add || is_search() after smt_getOption( ‘layout’, ‘cuttxton’ ) if( smt_getOption( ‘layout’, ‘cuttxton’ ) || is_search() ) But it will … Read more

Search with WP_Query, but ignore href URLs in anchor tags?

Please Use This. Solution Question:- Search with WP_Query, but ignore href URLs in anchor tags. Answer-> add_filter(‘posts_where’, ‘update_search_query’ ); function update_search_query($where) { if( is_search() ) { global $wpdb; $query = get_search_query(); $query = like_escape($query); $where .=” AND {$wpdb->posts}.post_content NOT REGEXP ‘\<a{1}.*.$query.*.<.a\>{1}’ “; } return $where; }

how to create custom taxonomy drop downs for parents and child

<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> <tr class=”form-field term-parent-wrap”> <th scope=”row”><label for=”parent”><?php _ex( ‘Parent’, ‘term parent’ ); ?></label></th> <td> <?php $dropdown_args = array( ‘hide_empty’ => 0, ‘hide_if_empty’ => false, ‘taxonomy’ => $taxonomy, ‘name’ => ‘parent’, ‘orderby’ => ‘name’, ‘selected’ => $tag->parent, ‘exclude_tree’ => $tag->term_id, ‘hierarchical’ => true, ‘show_option_none’ => __( ‘None’ ), ); /** … Read more