The code is below. But:
– The functions.php code definitely is gone with theme switch, AND
– The error message remains with theme change (I did not see that last time, but this time tested with WP22 and with the theme that is the parent of active child theme)
I have not tested for conflicts with other plugins yet.
Code is this –
<?php
// Defines
define( 'FL_CHILD_THEME_DIR', get_stylesheet_directory() );
define( 'FL_CHILD_THEME_URL', get_stylesheet_directory_uri() );
// Classes
require_once 'classes/class-fl-child-theme.php';
// Actions
add_action( 'wp_enqueue_scripts', 'FLChildTheme::enqueue_scripts', 1000 );
// Change excerpt length
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 150 );
// Disable Events menu up top
// show events menu in admin bar only for admins
if (!current_user_can('manage_options')) {
define('TRIBE_DISABLE_TOOLBAR_ITEMS', true);
}
// Remove Toolset admin notices for all users except admin
function remove_toolset_notices(){
if ( !current_user_can( 'administrator' ) ) { // test for administrator
add_action( 'admin_notices', function() {
remove_action( 'admin_notices', array( 'Toolset_Admin_Notices_Manager', 'show_notices' ) );
}, -1 );
}
}
add_action( 'init', 'remove_toolset_notices', 10 );
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
// Add Dashboard widget
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '<p><strong>Welcome to the "back end" of the website.</strong></p>
<p>Use the menu on the left to create or edit your Bio, Books or Events.</p>
<p>Click Dashboard to access the page you are on right now.</p>
<p>Click xxxxxxx to create or edit your xxxxxxx bio page.</p>
<p>Click xxxxxxx to add or edit your xxxxxxx.</p>
<p>Click Events to create and publish an event.</p>
<p>Members are encouraged to submit approval for RESOURCES and SPEAKERS BUREAU.</p>
<p>Questions or concerns? Please contact xxxxxxx via email: <a href="mailto:xxxxxxxorg</a></p>
<p>If you need to change your password, you can do that here: <a href="https://xxxxxxx/">Change password</a></p>';
}