How to search order using database frontend short code WordPress

Use the below code it may help you and sure that your sql query is correct then it will be work properly. function wpb_demo_shortcode() { global $wpdb; $results = $wpdb->get_results( $wpdb->prepare(“SELECT DISTINCT o.order_id, o.`order_item_name`, om.`meta_value` as ‘bcs’, (select pm.`meta_value` from `wp_postmeta` as pm WHERE o.order_item_id = om.order_item_id AND pm.`post_id` = o.order_id AND pm.`meta_key` = ‘2-certificate’) … Read more

Trying to get all links in my posts

After further investigation, I noticed my theme was actually replacing all the anchor tags with shortcodes for SEO purposes, so there weren’t any links in the content anymore. I was able to make it work by replacing $content = get_the_content(); with $content = apply_filters( ‘the_content’, get_the_content() );

How to change search page url so that it still returns a page when there’s no search query specified?

Isn’t that just because you’ve put ! empty( $_GET[‘s’] ) in your IF statement? Is your search page accessible when you remove that part? EDIT: Or maybe change your function to something like this (untested): function wpb_change_search_url() { if ( is_search() ) { if ( isset( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . … Read more

Adding overlay search to wordpress using add action/filter

First you need to edit your searchform.php file. If you are using get_search_form(); read this . In case you use search widget you need to override the Widget. If you dont want to use searchform.php you can go with filter: function wpdocs_my_search_form( $form ) { $form = ‘<form role=”search” method=”get” id=”searchform” class=”searchform” action=”‘ . home_url( … Read more

Return All Tags from Search Result in Separate List

Try this one: Just add the function in your theme functions file and then in your (search) template, add echo get_query_terms_list(); to display the terms list. But do take note, this is intended only for the current search results, i.e. on the same page. function get_query_terms_list( $taxonomy = ‘post_tag’, $sep = ‘, ‘ ) { … Read more

Using a new WP_Query inside the loop

It seems that the following code is at fault: $query_args[‘tax_query’] = array( array( ‘taxonomy’ => ‘edd_log_type’, ‘field’ => ‘slug’, ‘terms’ => ‘file_download’, ) ); It seems to be combining the tax_query args with those from the search query itself, by removing this I am getting a better result, although it is counting ALL logs, not … Read more