Title: sprowt's Replies | WordPress.org

---

# sprowt

  [  ](https://wordpress.org/support/users/sprowt/)

 *   [Profile](https://wordpress.org/support/users/sprowt/)
 *   [Topics Started](https://wordpress.org/support/users/sprowt/topics/)
 *   [Replies Created](https://wordpress.org/support/users/sprowt/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/sprowt/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/sprowt/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/sprowt/engagements/)
 *   [Favorites](https://wordpress.org/support/users/sprowt/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 40 total)

1 [2](https://wordpress.org/support/users/sprowt/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/sprowt/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/sprowt/replies/page/2/?output_format=md)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [escaping and translating clarification](https://wordpress.org/support/topic/escaping-and-translating-clarification/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/escaping-and-translating-clarification/#post-14060697)
 * hey BC 🙂
 * yes, you’re always helpful, thank you!
 * i’ll be sure to follow the directives in the link you sent.
 * have a great week <3
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [getting join() error with undefined $classes variable](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/#post-14046158)
 * that’s it, thank you!
 * after seeing it done in GP theme, i also cleared the `join()` error by passing
   the `$classes` arg twice as tom does in his footer.php.
 * a little digging paid off on that one.
 * as always, BC… i SO APPRECIATE your help and am really having fun with wordpress
   and php, thanks to you.
 * have a great weekend <3
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [getting join() error with undefined $classes variable](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/#post-14033022)
 * i should also mention that i do get `class=""` in the html elements i use function
   but the actual specific class isn’t output.
    -  This reply was modified 5 years, 8 months ago by [sprowt](https://wordpress.org/support/users/sprowt/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [getting join() error with undefined $classes variable](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/#post-14032572)
 * thanks for your time, BC.
 * here’s my theme repo:
    [https://github.com/LGitHub-sprout/wordpress/tree/main/wphierarchy/app/public/wp-content/themes/wphierarchy](https://github.com/LGitHub-sprout/wordpress/tree/main/wphierarchy/app/public/wp-content/themes/wphierarchy)
 * there’s not much in it except the functionality i’m having trouble with, so there’s
   not a lot of digging involved 🙂
 * i get null on `var_dump( $classes );`
 * `/app/public/wp-content/themes/wphierarchy/index.php:26:null`
 * i’m assuming the invalid join args is because $classes is null, and therefore
   neither a string nor an array of strings.
 * however, it is assigned in markup.php on line 30:
 *     ```
       if ( ! function_exists( 'wphierarchy_create_header_classes' ) ) {
         add_filter( 'wphierarchy_create_header_class',
                     'wphierarchy_create_header_classes' );
       /**
       * Adds custom classes to the header.
       */
       function wphierarchy_create_header_classes( $classes ) {
         $classes[] = 'site-header';
       }
         return $classes;
       }
       ```
   
 * other than that there’s not much to work back to.
 * what am i missing?? i’m stumped. unless this functionality is hooked into some
   other code in the the GP theme i’m not seeing/including.
 * thanks so much for your help!
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [getting join() error with undefined $classes variable](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/getting-join-error-with-undefined-classes-variable/#post-14030148)
 * forgot a link:
    [https://gist.github.com/LGitHub-sprout/467fe0db38eafeacabc44ea9cb737a0c](https://gist.github.com/LGitHub-sprout/467fe0db38eafeacabc44ea9cb737a0c)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] generate_do_element_classes](https://wordpress.org/support/topic/generate_do_element_classes/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/generate_do_element_classes/#post-13977165)
 * forgot to mark it solved
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] generate_do_element_classes](https://wordpress.org/support/topic/generate_do_element_classes/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/generate_do_element_classes/#post-13977162)
 * thank you, Tom <3
    will def look into that. i feel so lucky to be able to learn
   with GP and get a response to a Q. truly grateful <3
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [can’t get simple menu working](https://wordpress.org/support/topic/cant-get-simple-menu-working/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/cant-get-simple-menu-working/#post-13962152)
 * haha thanks, BC!
 * perhaps you won’t believe it, but i’m actually from Denver, Lol. so, you’re psychic
   in addition to other talents.
 * i posted the solution and gave credit to [@rup](https://wordpress.org/support/users/rup/)
   who helped me.
 * Be Well <3 !!
 *   Forum: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
   
   In reply to: [can’t browse themes in customizer when requiring files w content](https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/#post-13962141)
 * BIG thanks to stackexchange WP user, [@rup](https://wordpress.org/support/users/rup/)
   for help!
 * “But if that’s actual content you want to render into the page then you don’t
   want to be requiring it like that from the top level of your theme file: maybe
   from inside a function that you then call from one of your page templates, probably
   header.php? If you are rendering out from the theme’s functions I could imagine
   that might break the theme customisation pages, yes.”
    Rup Dec 16 ’20 at 22:19
 * answered my own Q with [@rup](https://wordpress.org/support/users/rup/)’s help.
 * rendering out directly from the required file was at least part of the problem.
 * i believe the other part was not rendering from inside a function as well as 
   not hooking all of that functionality into an action in the target file.
 * the problem vanishes and the content renders properly when these steps are followed:
 * require the file in functions.php using built-in WordPress function to the current
   theme’s template directory as indicated above.
 * create a simple action hook in the target file using `do_action()` function:
 * `do_action( 'namespace_hook_name' );`
 * create a (pluggable, if necessary) function in required file to render desired
   content (below is based on GeneratePress formatting). $priority and $accepted_args
   optional:
 *     ```
       if ( ! function_exists( 'namespace_func_name' ) ) {
       add_action( 'namespace_hook_name', 'namespace_func_name', $priority, $args );
   
       function namespace_func_name() {
          // code to render
         }
       }
       ```
   
 * search commercial themes for how they use action hooks as well as WordPress’s
   own default themes to learn more and practice.
 * [https://developer.wordpress.org/reference/functions/do_action/](https://developer.wordpress.org/reference/functions/do_action/)
 * [https://developer.wordpress.org/reference/functions/add_action/](https://developer.wordpress.org/reference/functions/add_action/)
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [can’t get simple menu working](https://wordpress.org/support/topic/cant-get-simple-menu-working/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/cant-get-simple-menu-working/#post-13918624)
 * i’m smh… yup, it was a typo :/
 * well, it happens to the best of folks, so i take it w a grain of salt.
 * i found an answer to this problem: [https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/](https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/)
 * should i post the solution, or does it matter?
 * thanks for your time, BC.
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [can’t get simple menu working](https://wordpress.org/support/topic/cant-get-simple-menu-working/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/cant-get-simple-menu-working/#post-13909551)
 * it works if i remove the `theme_location` from `wp_nav_menus`.
 * now the ‘container_class’ and ‘container_id’ also work without the `theme_location`.
 * why?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] require stmt jumbles element](https://wordpress.org/support/topic/require-stmt-jumbles-element/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/require-stmt-jumbles-element/#post-13786467)
 * thank you, [@ejcabquina](https://wordpress.org/support/users/ejcabquina/), for
   your reply.
 * when i require a file in my own theme like this:
 * `require get_template_directory . '/path/to/file.php';`
 * it breaks the <head> element and customizer as i describe above.
 * i thought i’d ask you since [@wordpress](https://wordpress.org/support/users/wordpress/)
   won’t respond which really frustrates and disappoints me.
 * so much for the great wordpress support community 🙁
 * but GP is great and you guys always respond, no matter what.
 * so thanks for that.
 * Lester
 *   Forum: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
   
   In reply to: [can’t browse themes in customizer when requiring files w content](https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/cant-browse-themes-in-customizer-when-requiring-files-w-content/#post-13746088)
 * update:
    browser flashes the contents of the required file and then loads the
   requested page as i select customizer or when i navigate to the admin > themes.
 * it flashes required file content **on any page** i try to navigate to.
 * for one particular install, i have neither plugins nor add’l themes (just 2017,
   2019, 2020) installed that would conflict.
 * i have checked how the twenty-* themes require nested files and have copied and
   pasted the code, and the behavior persists.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] wp_body_open and //phpcs:ignore notation](https://wordpress.org/support/topic/wp_body_open-and-phpcsignore-notation/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/wp_body_open-and-phpcsignore-notation/#post-13743216)
 * got it, thank you, Tom <3
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[GeneratePress] header templates and wp_head hook](https://wordpress.org/support/topic/header-templates-and-wp_head-hook/)
 *  Thread Starter [sprowt](https://wordpress.org/support/users/sprowt/)
 * (@sprowt)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/header-templates-and-wp_head-hook/#post-13733015)
 * yes, sir, those are the ones.
    ok, so i think your response confirms that i’m
   cluing into code organization (as much as a guy like i can ;-). it’s really cool
   how reading someone’s code gets you into their thought process. i’m taking online
   course in building themes and plugins from scratch and using GP as an additional
   guide. as always, Tom, much thanks and <3 for all you do for the community.

Viewing 15 replies - 1 through 15 (of 40 total)

1 [2](https://wordpress.org/support/users/sprowt/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/sprowt/replies/page/3/?output_format=md)
[→](https://wordpress.org/support/users/sprowt/replies/page/2/?output_format=md)