Foundation Scripts not loading (custom theme)

Benoti Yes, that was it! Seems app.js needs to be the last item loaded. Here is the final function with a couple of changes for anyone interested: function foundation_scripts() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, get_template_directory_uri().’/js/vendor/jquery.js’, false); wp_enqueue_script(‘jquery’); wp_enqueue_script(‘foundation-js’, get_template_directory_uri().’/js/vendor/foundation.js’, array(‘jquery’), false, true); wp_enqueue_script(‘what-input’, get_template_directory_uri().’/js/vendor/what-input.js’, false, true); wp_enqueue_script(‘app’, get_template_directory_uri().’/js/app.js’, array(‘jquery’, ‘foundation-js’), false, true); }

Ajax not updating to database

To test your AJAX is working add_action( ‘wp_ajax_editCommittee’, ‘test_ajax_request’ ); add_action( ‘wp_ajax_nopriv_editCommittee’, ‘test_ajax_request’ ); function test_ajax_request() { echo “Request: ” . PHP_EOL; var_dump( $_REQUEST ); exit; } And update your request to move the action into the data sent: jQuery (document).ready (function($) { $ (“.edit_tr”).click (function() { var commitID = $ (this).attr (‘id’); // on … Read more

Can’t find variable is_single in my jQuery plugin

The easiest way in WP to write php into JS is using wp_footer function sse246626_js() { if(is_single()) { echo ‘<script type=”text/javascript”>’; echo ‘jQuery(document).ready(function($) {‘; echo ‘$(“#mydiv”).hide();’; echo ‘});’; echo ‘</script>’; } } add_action(‘wp_footer’, ‘sse246626_js’); This way gives you access to the WP functions as you need, there are probably better ways of doing it if … Read more

How to create a radio button to alt between settings in wp_options table

fist of all set radio two radio button and give a name related like “cf_current_list” and have you set save button if yes then set code in functions.php file like if(isset($_REQUEST[‘buuton_nm’])){ if ( get_option( cf_current_list ) !== false ) { // The option already exists, so we just update it. update_option( cf_current_list, $_REQUEST[‘radio_btn_nm’] ); } … Read more

Open image gallery on link click

As I understand it, you want to show a div element containing the gallery when Show Gallery is pressed – otherwise to hidden. This can be accomplised with a couple of jQuery lines: $( “.show” ).click(function() { $( “.gallery” ).addClass( “display” ); }); With the appropriate CSS. See jsfiddle Be sure to remember to include … Read more

Printable Page with all Posts from Tag

I would recommend looking for a solution that would ‘print’ the relevant articles to a pdf format, which could then be printed. Search the plugins directory for terms such as ‘posts to pdf’ to find one that would allow you to print all posts in a certain category or with a certain tag.