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 query returning unexpected results

First thing first, mind your formatting. Future you thanks you! Second, you’ve just got some weird array sticking around in your $args variable. I believe what you’re looking for is meta_query which takes “an array of arrays” to compare by. Third I believe you’re also looking for posts_per_page, not numberposts. posts_per_page is the record limiting … Read more

Creating a WordPress addon for ContactForm7 submission (.XML file export)

The file is not created, because the function my_generate_xml exists, but is never called. All that code looks correct. The only problem is that you have to call the function that generates the XML file… add_action(‘wpcf7_before_send_mail’, ‘my_get_form_values’); function my_get_form_values($contact_form) { // get info about the form and current submission instance $formTitle = $contact_form->title(); $submission = … Read more

How to update option field in database on clicking the publish button in customizer

When ‘publish’ is clicked in customizer, the option ‘theme_mods_THEMENAMED’ is updated. An function/action could be added See https://developer.wordpress.org/reference/functions/add_action/ on the wordpress actions add_option_(option_name) and update_option_(option_name) See https://codex.wordpress.org/Plugin_API/Action_Reference#Administrative_Actions. The new function could then save what ever option you want to update.

Blog Image and Title in Right Sidebar

I think it’s easier to put the css code inside your theme through customize theme. wp-admin > appearance > customize To create a css that affects your sidebar posts like you want you need to post the html structure.

Show custom taxonomy in theme

If you want to list out the custom taxonomy you have to use get_terms function For your requirement instead of creating new taxonomy you can modify the default category it self function custom_change_cat_object() { global $wp_taxonomies; $labels = &$wp_taxonomies[‘category’]->labels; $labels->name=”Author”; $labels->singular_name=”Author”; $labels->add_new = ‘Add Author’; $labels->add_new_item = ‘Add Author’; $labels->edit_item = ‘Edit Author’; $labels->new_item = … Read more