How to Run a jQuery Script after a Javascript Script has Finished in WordPress

To accomplish this, wrap wp_enqueue_script in a function and run it through the action hook wp_enqueue_scripts while using the ‘priority’ parameter available in add_action to set the load order. function these_go_first() { wp_enqueue_script(‘first_script’, ‘[path to file]/first.js’, array(‘jquery’), ‘1.0’ ); } function these_go_first() { wp_enqueue_script(‘after_script’, ‘[path to file]/after.js’, array(‘jquery’, ‘first_script’), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘these_go_first’, 1); … Read more

Gallery Thumbnail Layout Template

One of the better approaches is to unregister WP’s default gallery shortcode function, and add your own customized replacement. WP engineer has a great post about it here. This also will let you fix that funky inline CSS that the default gallery adds to the page.

Query pages by category

It’s because the default query is only querying for post_type post, you have to explicitly add page to get it to also query for pages: $args = array( ‘cat’ => $current, ‘post_type’ => array( ‘page’, ‘post’ ) ); query_posts( $args );

Only show theme option if it option exists

If you’re wanting to output based on the option being defined, then use isset(). e.g. this: <?php echo $up_options->slideshow6; ?> …becomes this: <?php if ( isset( $up_options->slideshow6 ) ) { echo $up_options->slideshow6; } ?> EDIT How would I get the following to appear only if “slideshow6” was defined <a href=”#”><img src=”<?php echo $up_options->slideshow1; ?>” alt=”#”/></a> … Read more

Automatically load WordPress page on server every XX hours

You could use the WP-Cron functions to scheduled events. Note though that this is pseudo-cron- it requires someone (or a bot) visit your site for the events to execute. To fire events more reliably, search for scheduling cron jobs (linux) or scheduled tasks (win). Depending on your hosting, you may have access to simple tools … Read more

Add admin settings and options

I use this for my first theme please ignore little syntax error if any lol update: All the following code should go into your functions.php file Probably the best (and definitely the easiest) way to make a Theme Options Page is to use the WordPress Settings API. One note… everywhere you see THEME_NAME in my … Read more