user update profile for custom code

I can see $topselected= get_the_author_meta( ‘user_top’, $user->ID ); , here you are using “user_top” as the meta_key but while updating you are using “user_chapter” update_usermeta( $user_id, ‘user_chapters’, $_POST[‘user_chapters’] ); Whatever name you are providing in <select name=”user_top” id=”user_top”>, should be used in $_POST[”] So here you are using “user_top” as your select name, so it … Read more

Woocommerce variable products are being added to the card on the homepage (ajax)

I was trying to fix this at the last 4 hours and I got it. You need to change: ajax_add_to_cart add_to_cart_button button for this: button product_type_variable add_to_cart_button on the follow archives: wp-content/themes/tyche/inc/libraries/widgets/widget-tyche-products/view/layout-a.php wp-content/themes/tyche/inc/libraries/widgets/widget-tyche-products/view/layout-b.php wp-content/themes/tyche/inc/libraries/widgets/widget-tyche-products/view/layout-c.php wp-content/themes/tyche/inc/libraries/widgets/widget-tyche-products/view/layout-d.php Its located between lines 60~90. You need to change in every archive. Sorry for my bad English. Love the community, … Read more

Customizing WooCommerce with PHP

This is a very general Question and cannot be answered easily. The best place to start learning about something is by making your hand dirty. As a general rule that I found it relatively easy, first build something even if it is at first from the UI. Then start adding functionality by code or with … Read more

Website is loading with corrupted data once a while [duplicate]

This looks like the compressed content (GZIP maybe). If you have GZIP enabled for your website (on the server, or through some cache plugin), it can explain this. And the reason for you to see it, might be caused by the output being cut so that it can’t be uncompressed. This can be due to … Read more

Getting error in sql query

You have a typo $a = the_ID(); $data = $wpdb->get_results(“SELECT `id`,`guid` FROM `wp_posts` WHERE `post_type` = ‘local-offer’ group by `post_author`”); $result = $wpdb->get_results(“SELECT * FROM `wp_postmeta` WHERE `post_id` = “.$a.” “);

Display only upcoming events / Show all events when archive year is selected

Replace $today = date(‘Ymd’) with $hour = 0; $minute = 0; $second = 0; $month = (is_month()) ? get_the_date(‘m’) : 1; $day = (is_day()) ? get_the_date(‘d’) : 1; $year = get_the_date(‘Y’); $timestamp = mktime($hour, $minute, $second, $month, $day, $year); $search_date = date(‘Ymd’, $timestamp); // echo $search_date; In your query, replace ‘value’ => $today, with ‘value’ … Read more

Duplicate posts in my custom loop

You’re trying to loop through the thumbnail, which doesn’t make any sense: foreach ($thumbnail as $thumb){ And then inside the loop you’re referring to $thumbnail again anyway: <img class=”thumbnail zoom” src=”https://wordpress.stackexchange.com/questions/280435/<?php echo $thumbnail[0];?>” > wp_get_attachment_image_src() returns an array that looks like this: array( 0 => ‘http://website.com/path/to/image.jpg’, // URL 1 => 150, // Width 2 => … Read more

get/show Last ID

to have the ID, you can try this hook e.g. add_action(“save_post”, function ($post_ID, $post, $update) { if ( !$update && class_exists(“Flamingo_Inbound_Message”) && (Flamingo_Inbound_Message::post_type === $post->post_type) ) { // here $post_ID is the ID of the new created inbound message } }, 10, 3);

Sort WooCommerce data with WP-CRON?

This doesn’t sound like a bad approach to me. The thing to keep in mind about WP_CRON is that it’s not a “real” cron and is only triggered when someone visits the site. To that end, you could also do the check when the product page loads and hide the button as needed.