FiboSearch is highly customizable, offering several ways to modify its functionality. While many features can be configured through the FiboSearch settings page, you can extend its capabilities further with custom code. This guide provides you with the proper methods to safely add custom code to your website.
Table of Contents
Adding custom PHP code
Using the functions.php file or the Code Snippets plugin
To add custom PHP code, the best approach is to modify the functions.php
file of your theme. It’s recommended to use a child theme for this to prevent losing changes when the theme is updated.
- Navigate to
/wp-content/themes/<your-theme>/functions.php
. - Add your custom code at the end of the file.
If you’re not using a child theme or are uncomfortable editing theme files, you can use the Code Snippets plugin as an alternative:
- Install and activate the Code Snippets plugin.
- Go to
Snippets
>Add New
. - Enter a title for the snippet (optional).
- Paste your PHP code into the “Functions (PHP)” tab.
- Choose where to execute the code: on the admin panel, the front-end, or both.
- Save and activate the snippet.
Adding code to fibosearch.php
Certain FiboSearch features may require you to add custom code to a file called fibosearch.php
. This file should be created manually in the root directory of your child theme (next to functions.php
).
If you’re not using a child theme or are working with a non-theme builder (such as Oxygen), place the fibosearch.php
file directly in the wp-content
directory.
Note: Always ensure the file starts with the opening PHP tag (<?php
):
Modifying wp-config.php
For customizations that require changes to the wp-config.php
file, it’s crucial to add your code before the /* That's all, stop editing! Happy publishing. */
line:
Adding code after this line or in other parts of the file may cause errors or prevent the code from executing properly.
Adding custom CSS
To add custom CSS to your website, there are two options:
Via WordPress Customizer
- Navigate to
Appearance
>Customize
>Additional CSS
. - Paste your custom CSS code in the provided text box.
Using a plugin
- Install a plugin like Simple Custom CSS.
- Add your CSS code through the plugin interface.
For further assistance, you can refer to the following tutorial video: How to Easily Add Custom CSS to Your WordPress Site.
By following these guidelines, you can effectively extend FiboSearch with custom code tailored to your needs.