Search code examples
wordpresswordpress-theminghookredux-framework

How to set template path in redux framework?


I need to customize panel templates in my theme, which I use redux. I copied ReduxCore->templates->panel folder into mythemefolder->redux-framework->ReduxCore->templates->panel.

For some plugins, this overrides the templates from plugin, but not the case here, I found that I need to manually tell redux to look for the templates elsewhere other than default folder inside plugin. but I'm not sure how to do it.

I tried adding 'templates_path' => dirname(__FILE__).'/templates/panel', inside redux config file, but it just throws an error with Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)

then I found in redux docx,(https://docs.reduxframework.com/core/advanced/filter-hooks/) that there's another way to put redux/{opt_name}/panel/templates_path, but it has no reference how, or where to put this code.

can anyone help me out please?


Solution

  • https://docs.redux.io/guides/advanced/panel-templates.html

    Redux::setArgs('opt_name', array('templates_path'=> dirname(__FILE__).'/templates/panel/'));
    

    That SHOULD do it.