How to declare/provide file path in JQuery which is emeeded in the WordPress theme
$.get(‘<?php echo get_bloginfo(‘template_url’)?>/includes/func.php’, {
$.get(‘<?php echo get_bloginfo(‘template_url’)?>/includes/func.php’, {
The permalink structure you’ve described above e.g…./hotels/hamburg/features/sea-face isn’t really something that could be achieved by using custom fields. You would be better off creating a new taxonomy called ‘features’ and populating it with terms like ‘sea-facing’ and any others. In order to do queries for multiple taxonomies I would recommend the excellent Query Multiple Taxonomies … Read more
The answer is to use wp_register_style() and wp_enqueue_style() before I do wp_register_script() and wp_enqueue_script() so that I can use relative image paths to the CSS file. I then move the url() stuff from jQuery and into the CSS file with this relative path.
In WordPress 3.4 you have something called Theme Customizer that provide a optionpanel within wp-admin that enables you to see the changes in real-time. Maybe thats an option to go? Look at this video to see how it works: http://www.youtube.com/embed/amUjCfpIsJ4 Then you have themes like Headway that you can change the theme appearance on the … Read more
After some digging, I decided to try a hunch and it ended up working. Whether this is the sanctioned solution or not, but it has worked in my testing. For the AJAX url, add the $_GET variable ?action=[ajax_action] where [ajax_action] is your requested action. (ie. http://www.example.com/wp-admin/admin-ajax.php?action=[ajax_action]) Then make add_action(‘wp_ajax_nopriv_…’) include your action variable, ie. add_action(‘wp_ajax_nopriv_[ajax_action]’, … Read more
This is David Caplan, the web developer at Dolbeau. I don’t know how much web design experience you have but we basically just use the plain old carousel slider from Twitter Bootstrap (http://twitter.github.com/bootstrap/) with some extra javascript thrown in. The key is the CSS that allows the images to be full screen and centered, even … Read more
This sets $options to the value of test_theme in the database, you can go to phpmyadmin and the wp database and the wp_options (if wp is your prefix) and do a search on option_id row and you’ll find it there. To get this option it should be saved before in the database using add_option() and … Read more
I have managed to find the problem. Basically calling the google API from the footer was causing the maps to break and not function properly.
You have a typo: wp_ajax_ ajaxfunction. there’s a space after the underscore. also, use wp_localize_script to set your admin-ajax path: wp_enqueue_script( ‘contact’, get_bloginfo(‘template_directory’) . ‘/subscribe.js’, array(‘jquery’), ‘1.0’ ); wp_localize_script( ‘contact’, ‘ContactAjax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) ) ); then in your javascript, use ContactAjax.ajaxurl
Your stand-alone file doesn’t know the WordPress constants and functions. Use the native WordPress AJAX API instead. See also: What’s the preferred method of writing AJAX-enabled plugins? In short: Put all your custom code into a function or a class and hook from your plugin into … add_action(‘wp_ajax_ACTION_NAME’, ‘your_function’); … and … add_action(‘wp_ajax_nopriv_ACTION_NAME’, ‘your_function’); Replace … Read more