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

wp_signon works local, not on https

You need to set the auth cookie after wp_signon. Add this code and try and let me know the result. $user = wp_signon( $creds, false ); $userID = $user->ID; wp_set_current_user( $userID, $creds[‘user_login’] ); wp_set_auth_cookie( $userID, true, false ); do_action( ‘wp_login’,$creds[‘user_login’] );

Multiple image selection custom widget

I’ve found a solution by myself! With two lines of code I’m now able to save all the selected images and then retrive them on the front-end. I have added an array in the JS code part: // media library script (function($){ $(document).ready(function(){ $(document).on(‘click’, ‘.upload_image_button’, function(e){ e.preventDefault(); var button = $(this); var file_frame = wp.media.frames.file_frame … Read more