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 trim_content( $post_content, $length ) { | |
if (strlen($post_content) > $length) { // check to make sure your content is longer than what you want to display | |
$post_content = wordwrap($post_content, $length, "<br /><br />"); // Set br's to trim the content to the nearest whole word | |
$post_content = substr($post_content, 0, strpos($post_content, "<br /><br />")); // trim content | |
$post_content = strip_shortcodes( $post_content ); // strip shortcodes for wordpress content with shortcodes | |
return $post_content; | |
} |
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
// add to page template | |
<?php if ( has_post_thumbnail() ) : ?> | |
<?php $attachment_meta = wp_get_attachment( get_post_thumbnail_id() ); ?> | |
<div class="featured-image"> | |
<img src="<?=$attachment_meta['src'];?>" alt="<?=$attachment_meta['alt'];?>" title="<?=$attachment_meta['title'];?>"> | |
</div> | |
<?php endif; ?> | |
// add below function to functions.php |
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
# Compass is a great cross-platform tool for compiling SASS. | |
# This compass config file will allow you to | |
# quickly dive right in. | |
# For more info about compass + SASS: http://net.tutsplus.com/tutorials/html-css-techniques/using-compass-and-sass-for-css-in-your-next-project/ | |
######### | |
# 1. Set this to the root of your project when deployed: | |
http_path = "/" | |
# 2. probably don't need to touch these |
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
/** | |
* Helper function to determine if we're on the right edit screen. | |
* | |
* @global $pagenow | |
* @param $post_types array() optional post types we want to check. | |
* @return bool | |
*/ | |
function prefix_is_edit_screen( $post_types = '' ) { | |
if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
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: Things to Do | |
* | |
* @package visitnci | |
*/ | |
get_header(); ?> | |
<div id="primary" class="content-area"> |
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var watch = require('gulp-watch'); | |
var iconify = require('gulp-iconify'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var googleWebFonts = require('gulp-google-webfonts'); | |
var browserSync = require( 'browser-sync' ); | |
var reload = browserSync.reload; | |
var jshint = require('gulp-jshint'); | |
var uglify = require('gulp-uglify'); |
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: Library Resource List | |
* | |
* This is the template that displays all pages by default. | |
* Please note that this is the WordPress construct of pages | |
* and that other 'pages' on your WordPress site will use a | |
* different template. | |
* | |
* @package asotin_county_library |
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 | |
$things_to_do = pods( 'things_to_do' ); | |
$limit = 9; | |
$params = array( | |
'fields' => array( | |
'region', | |
'activity', | |
'legend_items' | |
), |
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 show_pods_modal_button() { | |
$fl_builder = pods_v('fl_builder', 'get', 'url'); | |
if (empty($fl_builder)) { | |
pods_view( PODS_DIR . 'ui/admin/shortcode.php', compact( array_keys( get_defined_vars() ) ) ); | |
echo '<a href="#TB_inline?width=640&inlineId=pods_shortcode_form" class="thickbox button" id="add_pod_button" title="Pods Shortcode"><img style="padding: 0px 6px 0px 0px; margin: -3px 0px 0px;" src="' . PODS_URL . 'ui/images/icon16.png" alt="' . __('Pods Shortcode' ,'pods') . '" />' . __('Pods Shortcode' ,'pods') . '</a>'; | |
} | |
} |
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 | |
$params = array( | |
'limit' => 3, | |
'where' => "source.meta_value = 'google'" // Relationship (Custom Simple) | |
); | |
$pods = pods( 'testimony', $params ); | |
if ( !empty( $pods ) ) { | |
while ($pods->fetch()){ |
OlderNewer