Dev doc

Woffice can be seen as a framework to support your applications. You will find many options from the theme settings and extensions.

However, those options actually represent a very small part of the available possible customizations. Indeed, Woffice is full of actions, filters and ready to be overwritten functions. 

To use those features, you need a Child theme so you can use its functions.php file to make your changes. See this article for more details. 

How to find the right action, filter or function?  #

You have access to the woffice source files as it is what you download from Themeforest. Therefore, you can use any code editor to make a global search and look for what you want, you will have to sort all the matches and will probably find the right filter. Otherwise, ask us. 

How do I use a filter or an action?  #

We highly recommend you to checkout these WordPress documentation pages: 

Let’s do a quick example to see how easy it is. 

The goal will be to change the logo’s link from the home page to any custom URL of your choosing:

1. You can use the code below:

apply_filters('woffice_logo_link_to', home_url( '/' ) );

2. Go to you woffice-child/functions.php file and open it with your favorite code editor, then just add your new filter: 

add_filter('woffice_logo_link_to', function($url) {    // Make any change here, just return a string which by default is $url which is: home_url( '/' )    return "";});

That’s a very simple example and does not make a lot of sense. But obviously you can do any kind of PHP process on your side and just use any link. 

3. Save and upload. 

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *