Skip to content

Instantly share code, notes, and snippets.

View ChrisCree's full-sized avatar

Chris Cree ChrisCree

View GitHub Profile
@ChrisCree
ChrisCree / page_archive-pages-only.php
Created November 17, 2014 16:35
Here is a page template that can be used with the Genesis framework to display only pages with the same layout as the Genesis Archive page template.
<?php
/**
* Page template file to display an archive list of only pages
*
*/
//* Template Name: Archive Pages Only
//* Remove standard post content output
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
@ChrisCree
ChrisCree / phpinfo.php
Created September 20, 2014 22:29
To find out what your website's server properties are including what version of PHP is running download this file as phpinfo.php and then FTP it up to your root WordPress directory. Then you can access it by going to your site's http://domain.com/phpinfo.php Remember to delete the file after you have the information you need!!
<?php phpinfo(); ?>
@ChrisCree
ChrisCree / taxtitle-functions.php
Created August 21, 2014 18:07
Add relevant page titles to custom taxonomy archive pages. This code can be dropped in the functions.php file. If used in a taxonomy.php template then omit the is_tax() conditional.
<?php
// Do not copy opening PHP tag above
// Add titles to custom taxonomy archive pages
add_action( 'genesis_before_loop', 'wsm_add_taxonomy_title' );
function wsm_add_taxonomy_title() {
if( is_tax() ) {
global $wp_query;
$term = $wp_query->get_queried_object();
$tax = $term->taxonomy;
@ChrisCree
ChrisCree / agentPress-listing-nav-functions.php
Last active June 9, 2021 15:09
Add Previous/Next navigation links to individual AgentPress Listings in the Genesis theme framework.
<?php
// Do not copy opening PHP tag above
// Add this code to your theme's functions.php file
// Add Previous/Next navigation to single listings
add_action( 'genesis_loop', 'wsm_add_listings_navigation' );
function wsm_add_listings_navigation() {
// bail if we aren't on a single listing CPT
if ( ! is_singular( 'listing' ) ) {
@ChrisCree
ChrisCree / full-content-archives-genesis.php
Last active August 29, 2015 14:04 — forked from robneu/full-content-archives-genesis.php
Modified to display full content for posts in all categories.
<?php
// Do not copy opening PHP tag above
// Force content archves ti display full post content with no featured image
add_action( 'genesis_before_loop', 'wsm_full_content_categories' );
function wsm_full_content_categories() {
if ( is_category() ) {
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'wsm_no_post_image' );
add_filter( 'genesis_pre_get_option_content_archive', 'wsm_do_full_content' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'wsm_no_content_limit' );
@ChrisCree
ChrisCree / childVersion-functions.php
Created July 23, 2014 16:20
To make your Genesis child theme display its version in the style sheet link instead of the Genesis version add this statement to your child theme's functions.php file.
<?php
// Don't copy opening PHP tag above
// Define child theme version
define( 'CHILD_THEME_VERSION', wp_get_theme()->get( 'Version' ) );
@ChrisCree
ChrisCree / comment-form.php
Created July 15, 2014 21:57
Remove comments from specific category posts in the Genesis theme framework.
<?php
// Do not copy opening PHP tag above
// Remove comments from specific categories. Change out categories in array as needed.
add_action( 'wp_enqueue_scripts', 'wsm_remove_comments_in_category' );
function wsm_remove_comments_in_category() {
if ( in_category( array( 'No Comments', 'Uncategorized', ) ) ) {
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
remove_action( 'genesis_after_entry', 'genesis_get_comments_template' );
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
@ChrisCree
ChrisCree / EventsListWidget_functions.php
Created June 12, 2014 00:04
Remove the recurring info from the Events List widget in the The Events Calendar Pro.
<?php
// Do not copy opening PHP tag above
// Events Calendar - remove recurring event info
add_filter( 'tribe_events_recurrence_tooltip', 'wsm_remove_tec_recurring_info' );
function wsm_remove_tec_recurring_info( $tooltip ) {
if( !is_singular() )
$tooltip = '';
return $tooltip;
}
@ChrisCree
ChrisCree / FullWidthHome_functions.php
Created June 11, 2014 20:19
Drop this code into your Genesis child theme functions.php file to force the home page to display with the full width content layout.
<?php
// Do not copy opening PHP tag above
// Force full width home page layout
add_filter( 'genesis_pre_get_option_site_layout', 'wsm_full_width_home_page' );
function wsm_full_width_home_page( $opt ) {
if ( is_front_page() ) {
$opt = 'full-width-content';
return $opt;
}
@ChrisCree
ChrisCree / read-more-functions.php
Created May 21, 2014 18:31
The normal "read more" code for Genesis does not add the read more link to short manual excerpts. The blow code will do so.
<?php
// Do not copy opening PHP tag
// Add Read More button to blog page and archives
add_filter( 'get_the_content_more_link', 'wsm_add_excerpt_more' );
add_filter( 'the_content_more_link', 'wsm_add_excerpt_more' );
function wsm_add_excerpt_more( $more ) {
return '<span class="more-link"><a href="' . get_permalink() . '" rel="nofollow">' . __( 'Read More', 'wsm' ) . '</a></span>';
}
add_filter( 'the_excerpt', 'wsm_add_short_excerpt_more' );