How to force the admin-ajax.php file to load over HTTPS?

If you are using Domain Mapping plugin doing this will quickly achieve exactly what you are asking for. Go to: YOURDOMAIN/wp-admin/tools.php?page=domainmapping Under: Excluded pages, check: Force SSL for all pages. Save and you’re done. Your insecure mixed content error due to admin-ajax.php loading via http instead of via https should be gone after this.

Create a post with REST API and adding a category

Solution was simple. Set DOM element value in JS variable instead of “document.getElementById(‘post_category’).value” in array. var submitBtn = document.getElementById(‘submit-post-btn’); submitBtn.addEventListener(‘click’, function(){ var categoryTerm = document.getElementById(‘post_category’).value; var postData = { “title”: document.getElementById(‘post_title’).value, “content”: document.getElementById(‘post_content’).value, “status”: ‘publish’, “categories”: [categoryTerm] } };

Create secondary Archive page format?

You could copy the contents of your current archive page file into a new file, then tweak the functionality there into what you need it to do. At the top of the file, give it a template name like this: /* Template Name: Short Archive */ Now you can create a new page and select … Read more

Ajax by worpdress affects called jquery inside template file

This will not work: function widget_data(){ include get_template_directory() . ‘/inc/wid/card/widget-card.php’; wp_die(); } The include statment includes the “widget-card.php” only into the file and not the output stream. You have to redirect the output into a variable and then output the value via “echo”. function widget_data(){ ob_start(); include get_template_directory() . ‘/inc/wid/card/widget-card.php’; $output = ob_get_clean( ); echo … Read more

WordPress 4.9.6 – IncludeMe & getAjax GET using wrong URL

If I run a curl command: curl ​https://theprepared.life/data/earthquakes-today.json I get back the json object correctly. So your server work properly. So unless from a different origin, when you running $.getJSON() call, you only need to submit data/earthquakes-today.json as the url, instead of the entire url, which caused the 404 error. $.getJSON(“data/earthquakes-today.json”, function(data) { // rest … Read more

How to send the checkbox value to email

First you need to add a class for all checkbox as having same id for multiple items is not recommended <input type=”checkbox” class=”new_class” id=’haet_mail_test_address’ name=”ckboxs[]” value=””.$emails[$i][“user_email’].”‘> Now we to change the way you are getting the values from checkbox Change var checkbox = $(‘#haet_mail_test_address’).val(); To var checkbox = $(“.new_class:checkbox:checked”).map(function(){ return $(this).val(); }).get(); console.log(checkbox); // check … Read more

How to inject data content from external json into a modal, using UIkit?

Ok. The solution I found out, was more simple than I thought. On the script use “jQuery” instead of “$”. HTML trigger: <a href=”#myModal” onclick=javascript:openModal({{id}})><article>… </article></a> function openModal(id){ jQuery.ajax({ type: “GET”, url: ‘https://www.example.json’ + id, dataType: ‘json’, success: function(data) { var data = data.T.ads; var infoModal = jQuery(‘#myModal’); infoModal.find(‘.uk-modal-title’).html(data[0].brand + ‘ ‘ + data[0].model); htmlData=”<p>” … Read more