How to edit/replace Parent functions.php function in Child Theme to add “Walker” class

Go to your functions.php in your child theme add this: function childtheme_override_tesseract_output_menu( $cont, $contClass, $location, $depth ) { //tesseract_output_menu function code modified as you wish here } In your parent theme functions.php, wrap the tesseract_output_menu function like this: if (function_exists(‘childtheme_override_tesseract_output_menu’)) { /** * run the child override */ function tesseract_output_menu() { childtheme_override_tesseract_output_menu(); } } else … Read more

Custom styles in Tiny MCE with an external CSS file

The path to the CSS file tinymce.min.css was incorrect. The solution was to change: $url .= trailingslashit( plugin_dir_url(get_stylesheet_directory_uri()) ) . ‘/tinymce.min.css’; to: $StyleUrl = get_stylesheet_directory_uri().’/style-sheets/tinymce.min.css’; I also had to change: $StyleUrl = plugin_dir_url(get_stylesheet_directory_uri()).’tinymce.min.css’; to: $StyleUrl = get_stylesheet_directory_uri().’/style-sheets/tinymce.min.css’; Now all I had to do was to remove the styles array so the complete code is: // … Read more

WP Customizer API loaded into functions.php

Yes. You can load the code in the customize_register action. One example: <?php // File: functions.php add_action( ‘customize_register’, function( $wp_customize ) { require_once dirname( __FILE__ ) . ‘/inc/customize.php’; wpse256532_customize_register( $wp_customize ); } ); And the inc/customize.php file: <?php // File: customize.php function wpse256532_customize_register( $wp_customize ) { $wp_customize->add_setting( /* … */ ); $wp_customize->add_control( /* … */ … Read more

Add Link to Users List (Backend) to open each users front-end profile

The following will add a “View author profile” link to the row actions (i.e., the links that appear when you hover over the username): add_filter (‘user_row_actions’, ‘add_view_author_page’, 10, 2) ; function add_view_author_page ($actions, $user) { $href = esc_attr (get_author_posts_url ($user->ID)) ; $actions[‘add_view_author_page’] = “<a href=”https://wordpress.stackexchange.com/questions/259665/$href”>View author page</a>” ; return ($actions) ; } Edit: Or if … Read more

Tracking the number of shortcodes for a list?

Wrap an <ol> around them and have your [resource] shortcode create an <li> for each one. Editor view: <ol> [resource name=”Resource” link=”http://foo.com”]Why I love it[/resource] [resource name=”Another Resource” link=”http://footwo.com”]Why I love this[/resource] </ol> HTML output: <ol> <li><a href=”http://foo.com”>Resource</a><p>Why I love it</p></li> <li><a href=”http://footwo.com”>Another Resource</a><p>Why I love this</p></li> </ol>