This file contains hidden or 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
//* Shortcode to print a responsive image | |
//* Example shortcode: [responsive-image url=http://info-graphic.ca/wp-content/uploads/2016/11/graph2-s.jpg] | |
add_shortcode('responsive-image','func_responsive_image'); | |
function func_responsive_image($atts) { | |
if(isset($atts['url'])): | |
$image_url = $atts['url']; | |
else: | |
echo 'Image not specified'; | |
endif; | |
This file contains hidden or 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
//display list of subpages with featured images as thumb | |
//get the list of child pages | |
$mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); | |
//if the page has no children, get the parent's children | |
if ( !$mypages) | |
$mypages = get_pages( array( 'child_of' => wp_get_post_parent_id( $post_ID ), 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); | |
foreach( $mypages as $page ) { | |
if ( $page->ID != $post->ID){ //don't display the member's thumbnail if it's the member's page | |
$content = $page->post_content; |
This file contains hidden or 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 "Read More" link to automatic excerpts | |
add_filter('the_content_more_link', 'wpm_get_read_more_link'); | |
add_filter('get_the_content_more_link', 'wpm_get_read_more_link'); // Genesis Framework only | |
add_filter('excerpt_more', 'wpm_get_read_more_link'); | |
function wpm_get_read_more_link() { | |
global $post; | |
return '… <a href="' . get_permalink($post->ID) . '">[Continue reading] <span class="screen-reader-text">' . get_the_title() . '</span></a>'; | |
} | |
// Add "Read More" link to hand-crafted excerpts |
This file contains hidden or 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
//goes to wp-config.php | |
ini_set('log_errors','On'); | |
ini_set('display_errors','Off'); | |
ini_set('error_reporting', E_ALL ); | |
define('WP_DEBUG', false); | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); |
This file contains hidden or 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
.products h3 { | |
display: block; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} |
This file contains hidden or 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 sidebar to blog posts | |
add_action( 'genesis_pre_get_option_site_layout', 'gc_add_primary_sidebar' ); | |
function gc_add_primary_sidebar() { | |
if ( is_home() || is_singular('post') || is_category() || is_month() ) { // for archives and single post pages | |
/* list of options | |
content-sidebar | |
sidebar-content | |
content-sidebar-sidebar | |
sidebar-sidebar-content | |
sidebar-content-sidebar |