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: Register Helper Example | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Register Helper Initialization Example | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded |
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 | |
/* <name of> child theme */ | |
// Faster than @import | |
add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' ); | |
function my_child_theme_scripts() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} |
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
/* | |
Theme Name: <theme name> | |
Theme URI: http://rezzz.com | |
Author: Jason Resnick | |
Author URI: http://rezzz.com/jason-resnick/ | |
Description: A Child theme off of <parent theme> built for the <name of> website | |
Version: 1.0 | |
Template: <parent theme directory name> | |
Text Domain: <name of>-child | |
*/ |
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
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
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
<?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
/** | |
* 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
# 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
/* Disable the Admin Bar & Setting in Profile. */ | |
add_filter( 'show_admin_bar', '__return_false' ); | |
function jr_hide_admin_bar_settings() { | |
?> | |
<style type="text/css"> | |
.show-admin-bar { | |
display: none; | |
} | |
</style> |