The following will completely remove beans_header
and replace it with markup of your choosing.
beans_modify_action( 'beans_header_partial_template', 'beans_site_prepend_markup', 'add_custom_header' );
function add_custom_header() {
// construct your header here
$your_new_header = '<header class="custom-header"><div class="yo">yo yo yo!</div></header>';
echo $your_new_header;
}
You could use the hook beans_main_prepend_markup
instead of beans_site_prepend_markup
as you suggested, but then the header would actually be located at the top of the content section.
For the footer, so as above except use beans_modify_action( 'beans_footer_partial_template', 'beans_site_append_markup', 'add_custom_footer' );
.
Awesome! This worked great. 🙂
Now I'm trying to puzzle out how to add a link for the SVG logo that will go in the custom header html. The past methods I've used to add images to wordpress php files don't seem to be working. The path I'm using is
child-theme-name/assets/logo.svg
It seems like php (to insert the image link) placed into the following code won't execute.
'<header class="custom-header"><a href=""><img src=""></a><div class="yo">yo yo yo!</div></header>'
``` Is it a simple matter of escaping properly, or is something else more elaborate required?
Thank you!
There's no PHP in your example (and the last part of your post got caught in the code snippet!). Can you share the code which you mentioned isn't working?
If your logo is located in your child theme folder, I don't see why it wouldn't work to create a variable $my_logo = get_template_directory_uri() . '/assets/logo.svg';
then call it like <img src="<?php echo $my_logo; ?>">
.
You mentioned that most of your site is static and separate from the portion you're building on Beans. How exactly do you have this set up?