Cant get the templates stack filter to work
-
Hi,
Thank you for this really well built plugin.
Im just starting integrating it with my Timber workflow, which requires me to do some substantial templating to achieve total controlo over the layout.
The first step was to try having the plugin loading templates from a custom location on my theme structure, but I would rather not having all the files at the root of the theme, so I was declaring it like this:
add_filter( 'eventorganiser_template_stack', 'my_callback_function' ); function my_callback_function( $stack ){ $new_array[] = CHILD_DIR . "/events"; array_unshift( $stack, CHILD_DIR . "/events" ); var_dump($stack); return $stack; };
This does seem to do what was expected, the dump above returns the following:
array(4) { [0]=> string(49) "/var/www/html/wp-content/themes/wip-avenue/events" [1]=> string(42) "/var/www/html/wp-content/themes/wip-avenue" [2]=> string(41) "/var/www/html/wp-content/themes/wip-roots" [3]=> string(58) "/var/www/html/wp-content/plugins/event-organiser/templates" }
The first item in that array is returning the correct path where I have my templates, but nothing happens on the front-end and is still loading the default templates.
Am I missing something here?
Thanks.
- The topic ‘Cant get the templates stack filter to work’ is closed to new replies.