This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: As a result, we only stick the site's wp-content in the repo | |
# | |
# See the comments below for more info on how to add exceptions for your | |
# content. Or see git's documentation for more info on .gitignore files: | |
# http://kernel.org/pub/software/scm/git/docs/gitignore.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom admin login header logo | |
*/ | |
function jr_custom_login_logo() { | |
echo '<style type="text/css">'. | |
'h1 a { background-size: 201px 35px !important; background-image:url('.get_bloginfo( 'template_directory' ).'/images/logo.png) !important; }'. | |
'</style>'; | |
} | |
add_action( 'login_head', 'jr_custom_login_logo' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Blank Page | |
Template By : Jason Resnick | |
URL : http://rezzz.com | |
*/ | |
?> | |
<!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jr_add_loginout_navitem($items, $args ) { | |
if( $args->theme_location == 'header_nav' ) { | |
if ( !(is_user_logged_in()) ) { | |
$login_item = '<li class="nav-login"><a href="/login">Log In</a></li>'; | |
} | |
else { | |
$login_item = '<li class="nav-login">'.wp_loginout($_SERVER['REQUEST_URI'], false).'</li>'; | |
} | |
$items .= $login_item; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_excerpt_by_id($post_id, $n){ | |
$the_post = get_post($post_id); //Gets post ID | |
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt | |
$excerpt_length = $n; //Sets excerpt length by word count | |
$the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images | |
$words = explode(' ', $the_excerpt, $excerpt_length + 1); | |
if(count($words) > $excerpt_length) : | |
array_pop($words); | |
// array_push($words, '…'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$attractions = get_terms('attraction', array("fields" => "names")); | |
for ( $myterm = 0; $myterm < count($attractions); $myterm++) { ?> | |
<h3><?php echo $attractions[$myterm]; ?>:</h3> | |
<div class="taxonomy_group"> | |
<?php $loop = new WP_Query(array('attraction' => $attractions[$myterm])); | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
get_template_part( 'content', 'things-to-do' ); | |
endwhile; ?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Filter Recent Posts based around the categories of the post being displayed | |
*/ | |
function rez_widget_posts_args( $args ) { | |
if ( is_single() ) { // Only want to appear on blog posts. | |
$post = get_queried_object(); | |
$categories = wp_get_post_categories( $post->ID ); | |
$cats = implode( ',',$categories ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Re-order Checkout Fields | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'rez_move_checkout_fields' ); | |
function rez_move_checkout_fields( $fields ) { | |
$fields2['billing']['billing_email'] = $fields['billing']['billing_email']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_enqueue_scripts', 'custom_admin_scripts_styles' ); | |
function custom_admin_scripts_styles() { | |
global $post_type; | |
if ( 'course' == $post_type ) { | |
global $post_type; | |
wp_dequeue_script( 'select2' ); | |
wp_dequeue_style( 'select2' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Plugin Extension Boilerplate | |
* Plugin URI: https://rezzz.com/ | |
* Description: Extend an existing plugin with more functionality (based: https://codeable.io/community/how-to-extend-a-wordpress-plugin-my-plugin-boilerplate/) | |
* Version: 1.0.0 | |
* Author: Jason Resnick | |
* Author URI: https://rezzz.com/ | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html |