Wordpress Archives - thehazels Wordpress Archives - thehazelsthehazels

Category Archives for Wordpress

Ajax queries are redirected (admin-ajax.php 302)

I’ve just spent a lot of time working out why an ajax function was not working for non-logged in users. I’d added an action add_action(‘wp_ajax_nopriv_my_function’, ‘my_function’) and I’d made sure admin-ajax.php was localized wp_localize_script(‘ajax-post’, ‘wp-ajax’, array(‘ajaxurl’ => admin_url(‘admin-ajax.php’)). Unfortunately the call was … Continue reading

19. January 2015 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment

Backups

I’ve been looking at various backup plugins to try and see how reliable it would be to set up an automated backup. As ever the main requirement is free of charge since I can’t pass on the cost. There seem … Continue reading

12. March 2014 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment

Testing google maps

02. March 2014 by Antonia Whitaker
Categories: Wordpress | Leave a comment

My results of trying out various calendar plugins

I wanted: no charge (for a club website) ajax event view recurring events with a means of deleting or ignoring specific dates (e.g. for a bank holiday) simple to add a new event link to a map – would be … Continue reading

21. January 2014 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment

wp_enqueue_script warning

Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) This PHP notice warning … Continue reading

07. January 2014 by Antonia Whitaker
Categories: Wordpress | Tags: , | Leave a comment

remove_action function

There are occasions using a child theme when you want to replace the original action with your own. WordPress provides a function for this: <?php remove_action( $tag, $function_to_remove, $priority, $accepted_args ); ?> However, if you are overriding a parent theme, then the action will not yet exist. … Continue reading

11. December 2013 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment

External Links

I like to have all external links open in a new window. However, the traditional method of target=_blank is not XHTML compliant. So another option is to use JavaScript’s window.open function. Open external links in a new window, is a … Continue reading

28. November 2013 by Antonia Whitaker
Categories: Wordpress | Tags: , | Leave a comment

Useful Plugins

List of useful plugins, plus ideas for creating own Continue reading

07. November 2013 by Antonia Whitaker
Categories: To Do, Wordpress | Tags: , , | Leave a comment

Queries

for PHP error reporting, set WP_DEBUG to true in wp-config.php new WP_Query : fetch posts and pages, e.g. while ($query->have_posts()) {   $query->the_post(); echo the_title() . the_content(); } $query->result: whole thing $query->request: sql query

23. October 2013 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment

Modifying a theme

The best way to make any changes to a theme is to create a child theme. Full details are in the WordPress Codex. Here’s a reminder of the steps: Create directory for theme in wp-content/themes – convention is <name of … Continue reading

19. October 2013 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment