Swapping wp_dropdown_categories function with wp_category_checklist

As you are not working with the default categories but with another taxonomy instead you must not use wp_category_checklist(). Instead you should probably be using the more generic wp terms checklist(). The signature of this function also differs from the one of wp_dropdown_categories(). And the arguments array takes completely different options. You shlould start with … Read more

Saving changes in wp_editor

First of all the the_editor() function has been deprecated and it’s advised to use the wp_editor() instead. Just to explain how the value is being saved, your value in the textarea isn’t being saved by the textarea element but instead and most likely by update_post_meta. To replace your textarea with wp_editor, you can define it … Read more

Use menu link or onClick to set a variable

By this you can pass the value using ajax, you have fetch value from $_POST in your php script jQuery(document).ready(function(){ jQuery(‘.dayLink a’).click(function(){ var li_id = jQuery(this).closest(‘.dayLink’).attr(‘id’); jQuery.ajax({ url: ‘url_to_php_script’, data: {dayValue: li_id,action:call_to_ajax}, method: ‘POST’, success: function(res){ console.log(res); } }) }); }); The closing brackets were out of order. <?php if(isset($_GET[‘li_id’])){ $test = $_GET[‘li_id’]; echo $test; … Read more

Create onClick Event to Re-load a Widget

I think you something like this. HTML Add this in widget <a href=”https://wordpress.stackexchange.com/questions/254474/javascript:void(0)” id=”add_my_fav”>Add To Favourite<span id=”favCount”></span></a> Ajax Add this in template <?php $nonce = wp_create_nonce(‘addToFav’); ?> <script> jQuery(document).read(function(){ jQuery.ajax({ url: ‘http://example.com/wp-admin/admin-ajax.php’, data: {action:”add_to_favourite”, secret:”<?php echo $nonce; ?>”}, method: ‘POST’, success: function(res){ jQuery(‘#favCount’).html(res); } }) }) </script> PHP Add this in functions.php function addToFavourite(){ if(isset($_POST[‘secret’]) … Read more

WordPress on AWS with ELB

Finally I managed to solve this issue. The problem i had was on the ELB with the sticky sessions. I just enabled it and set a time of 3600 and now wordpress in login in users. A question remains with the real ELB power. If you do this sticky session I found some documentation that … Read more