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

add php code within html in wordpress

Welcome to WPSE. First you need to sort out, WHERE you want to execude your php code. Frontend? Backend? Login Page? After that: In case it is backend related, add your code via a filter in your functions.php of your theme. In case it is frontend code, add it 1) either via a filter 2) … Read more

Custom Loop.php having a loop inside a loop

Changes it so it works. <?php $i = 1; $icount = 1; ?> <?php while ( have_posts() ) : the_post(); if ($icount < 11) { if ($i % 5 == 0) { echo ‘<div class=”col5x2″>’; include ‘modules/projects/small-square.php’; echo ‘</div>’; $i = 1; $icount++; continue; } if($i % 2 == 1): echo ‘<div class=”col5″>’; endif; include … Read more