How to load a plugin when doing an Ajax call? [duplicate]

You are not using ajax right. Why are you adding your ajax callback function to the init action? You need to read http://codex.wordpress.org/AJAX_in_Plugins Attach your ajax callback function to wp_ajax_your_defined_action like this: add_action( ‘wp_ajax_your_defined_action’, ‘your_callbck_function’ ); For this to work you have to use wp-admin/admin-ajax.php as your ajax url and you have to post your_defined_action … Read more

CSS conditional on custom field value

Without any other context (which means you will likely need to adapt to your specific needs), I would consider using the post_class filter. Using this filter, you can access the post meta for the current post, and conditionally add a CSS class to the post container. For example: function wpse129167_filter_post_class( $classes, $class, $postid ) { … Read more

Display ajax preloader for large images within posts

How you said one option is to place a preloader while the image is loading. If you cannot touch so deep with JavaScript and PHP I have one simple sugestion which I think will work for you. <div class=”image-preloader”> <img src=”https://wordpress.stackexchange.com/questions/129186/yourimage.jpg” alt=”” /> </div> Create a wrapper (holder) around your image. With CSS put the … Read more