Pro: add to functions.php

Hello- I need to add some code to my functions.php file however on past themes there was a dedicated section to add custom functions, however on yours there is not a dedicated area-

so what part do I add it to?

(I have bought a flyout plugin similar to your off canvas content- because forms don’t work in your off canvas content which is I would say the primary use of the off canvas content) in anycase I do not know which line to add it to

here is the code

add_action( 'bne_flyout_content_after', function() {
	?>
	<div class="custom-close-btn flyout-close">Close Flyout</div>
	<?php
});

Hey @b960a518-a049-4215-9,

What part of your site you need it added to or displayed? Judging on the code you posted, it looks like you don’t have to add it using functions.php as it’s content is just simply HTML. You can simply add the HTML in the widget area or in Content Area element. You can even add a Button element and try adding the classes in your code like this:

If you want to add it in the head or footer, try using following this guide https://kinsta.com/knowledgebase/add-code-wordpress-header-footer/

Thanks.

I’d like to know where to put it in the functions file for future reference as well

Hi @b960a518-a049-4215-9,

You should add it to your child theme’s functions.php (eg. wp-content/themes/x-child/functions.php ). Just append it to the end of the file content.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.