Trying to fix multiple category drop down

The HTML seems correct, as Price dropdown contains the right cat ID. I guess this is a JS problem, my first guess is that you shouldn’t use the same variable name in both scripts. Replace dropdown by dropdown_price for second one, like : <!–DROPDOWN SORT CATEGORY 2–> <script type=”text/javascript”> var dropdown_price = document.getElementById(“cat2”); function onCatPriceChange() … Read more

Stop loading more posts if none left AJAX

Yes use wp_query 🙂 Anyway, to prevent loading posts while you’re out of pages, you need to know the current page number last loaded and the total number of pages that exist. Total pages that exist: $max = $wp_query->max_num_pages; Current page: just count it in your load loop, so set the var to 1, then … Read more

Dynamic Gallery

You can use Advanced Custom Fields plugin – paid, to to that: http://www.advancedcustomfields.com/add-ons/gallery-field/ Plase what a video. Also on lightbox you need this Jquery plugin: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ Create a custom post type with name gallery. Then create a page-gallery.php and put this code: : <?php $args=array( ‘post_type’ => ‘gallery’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 12, ‘paged’ … Read more

Plugin and javascript placement

You can take advantage of html5 data-* attributes. In your shortcode function, output a class name and the data attributes you’ll need: function my_plugin_shortcode( $shortcode_settings ) { $elem_id = ‘elem-id’; $settings_id = ‘my-plugin-settings-id’; $output=”<div class=”my-plugin-class” id=”#”.$elem_id.'” data-settings-id=”‘.$settings_id.'”></div>’; return $output; } Then create a script named init.js and use wp_enqueue_script. Inside it put: jQuery(document).ready(function($){ $(‘.my-plugin-class’).each(function(){ // … Read more