The first thing to do is to install Git on the remote server.
Once you do that the rest of the process is split into three sections:
- Server set-up
- Local set-up (push commits)
- Server (pull commits)
| <?php | |
| /** | |
| * gets the current post type in the WordPress Admin | |
| */ | |
| function get_current_post_type() { | |
| global $post, $typenow, $current_screen; | |
| //we have a post so we can just get the post type from that | |
| if ( $post && $post->post_type ) | |
| return $post->post_type; |
| // This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.github.io | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
| */ |
| # Filename-based cache busting | |
| # taken from https://github.com/h5bp/html5-boilerplate/ | |
| # This rewrites file names of the form `name.123456.js` to `name.js` | |
| # so that the browser doesn't use the cached version when you have | |
| # updated (but not manually renamed) the file. | |
| <IfModule mod_rewrite.c> | |
| Options +FollowSymlinks | |
| RewriteEngine On |
| <?php | |
| function my_homepage_scripts() { | |
| if ( is_front_page() ) { | |
| // jQuery Cycle plugin | |
| wp_register_script( 'jquery-cycle', get_template_directory_uri() . '/js/libs/jquery.cycle.all.js', array( 'jquery' ), '2012-03-13T10:15', false ); | |
| wp_enqueue_script( 'jquery-cycle' ); | |
| // Custom settings for jQuery Cycle | |
| wp_register_script( 'jquery-cycle-settings', get_template_directory_uri() . '/js/jquery-cycle-settings.js', array( 'jquery-cycle', 'jquery' ), '2012-04-13T10:15', false ); |
| /* | |
| * This is a base container for | |
| * whenever I use jQuery Cycle. | |
| * http://jquery.malsup.com/cycle/ | |
| * | |
| * Use this as base HTML | |
| * | |
| * <div id="slider"> | |
| * <div id="slides"> | |
| * <div class="slide" style="display:block">...</div> |
| <?php | |
| /** | |
| * Displays a list of terms for a specific taxonomy. | |
| * Based on Justin Tadlock's [entry-terms] shortcode | |
| * Added attribute to not link to the taxonomy | |
| * using wp_get_object_terms() to do so | |
| * | |
| * @author Brian Krogsgard | |
| * | |
| * @access public |
| <?php | |
| // An example of creating two separate WP queries, combining the results, | |
| // sorting by date and formatting the results for us in a loop like a regular query. | |
| // order the posts by date in descending order (should go in functions.php to keep things tidy) | |
| function order_by_date( $a, $b ) | |
| { | |
| return strcmp( $b->post_date, $a->post_date ); | |
| } |
| /** | |
| * Extend Recent Posts Widget | |
| * | |
| * Adds different formatting to the default WordPress Recent Posts Widget | |
| */ | |
| Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { | |
| function widget($args, $instance) { | |
| // --------------------------------------------------------- | |
| // ---------- WordPress functions.php boilerplate ---------- | |
| // --------------------------------------------------------- | |
| <?php | |
| // ---------------------------------------------------------------------------- | |
| // ---------- Translations can be filed in the /languages/ directory ---------- | |
| // ---------------------------------------------------------------------------- | |
| load_theme_textdomain( 'html5reset', TEMPLATEPATH . '/languages' ); |