Custom Post type slider with thumbnail navigation

Follow this flow: Define an empty array $nav_img = array(); outside the loop. Inside the loop while you fetch the featured image, push the URL to the array too like this $nav_img[]=’your_image_here’ ; Then inside <div class=”slider-nav-thumbnails”></div> you can simply do a for each loop to set the images as thumb. UPDATE: Here I added … Read more

If Array Values Match Another Array’s Values, Then

Here’s one way to solve this: sort both arrays loop through them and compare them item by item (they should be equal, because arrays are sorted) . sort( $evaltypesReq ); sort( $evaltypesSch ); $containsAllValues = true; foreach ( $evaltypesReq as $k => $v ) { if ( $evaltypesSch[$k] !== $v ) $containsAllValues = false; }

How to access or parse key/values that have “string”

In it’s current state you would directly get the value from the associative PHP array by directly referencing the key like so: var_dump( $form_data[‘key’] ); It’s wise to note that when you dump variables using var_dump you get information on the value type, and length. So in this case you get string(33) which indicates the … Read more

After adding my website to a new server, I keep getting a unexpected end of file error, but the file is identitcal to it’s original source

So the issue has already been resolved via the comments and the current state of the question already includes the corrected code. But I thought I should post this answer as a reminder for you, me and everyone reading this. 🙂 So first off, here’s a helpful excerpt from an article on WP Engine: The … Read more

Change text string in a plugin

You are able to change texts using a translation file. By default, plugin texts are in the English language. Even your site language is English, You are able to generate a new language file and change texts on it. Imagine that the plugin folder name (plugin slug, plugin text domain) is my-plugin and Your site … Read more

WP check_ajax_referer() is not working

One is When I use the shortcode of the form in the page or post, showing the form in the WP backend 5.2.3 version. That happens because your shortcode is echoing the output. A shortcode should always return the output, but if you need to echo it, then you should use output buffering: public function … Read more

Loop in elementor custom widget not working

I would recommend switching to a standard post loop: $args = [ ‘posts_per_page’ => 12, ‘category_name’ => ‘featured’, ‘orderby’ => ‘post_date’, ‘order’ => ‘ASC’, ]; $query = new \WP_Query($args); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); ….. } \wp_reset_postdata(); } Note that I: switched to modern PHP array syntax of [] … Read more