Invalid Argument foreach

simple_fields_get_post_group_values might be returning null or false. Try adding: $leftsidebar = simple_fields_get_post_group_values($post->ID, “Left Sidebar”, false, 2); echo “<!–“.print_r($leftsidebar).”–>”; And check the source of the page to see what’s returning.

cant insert data in a custom table in phpmyadmin

I would strongly suggest using AJAX for this purpose. Using “init” for inserting some data to your database is not a good solution. Here’s a good guide on how to do it with AJAX: https://webprogramo.com/how-to-create-an-ajax-form-in-wordpress/1156/

Block that renders html saved in a php file

If you are working on a WordPress Theme you can use the function: get_template_part( string $slug, string $name = null ) Wich loads a template part into a php template. get_template_part() will do a PHP require() for the first file that exists… So effectively it will work as if you were requiring another php file. … Read more

Implement jQuery Smart wizard

I haven’t used this jQuery library myself, but based on a quick glance on the documentation, you could probably just wrap the wizard inside a <form> tag and add a custom handler for the smartWizard onFinish event. When the event is fired, send the form data to server with either admin ajax or REST API. … Read more

Get WordPress username to customize url

You can only do that if the user is logged in (otherwise there is no “current” user). Depending on what your specific use case is, it would be something like this: if ( is_user_logged_in() ) { global $current_user; $current_user = wp_get_current_user(); // get the username: $username = $current_user->user_login; // set up the URL: $url = … Read more