Extend Events theme file from another plugin

10 views
Skip to first unread message

nddery

unread,
Jul 22, 2011, 11:44:19 AM7/22/11
to event...@googlegroups.com
Hi all,

I am currently creating a plugin that needs to interact with EventPress and I am trying to extend the default Events page form the plugin. What I would like to achieve is to extend the theme file "lookup" so it looks at the current theme folder, my plugin theme folder, and resorts to EventPress plugin files if nothing is found.

Is this something achievable ?

In the code, in wp.php, it seems like the current page "structure" will be completely rebuilt, it says it will be derecated as of version 1.3.

Thanks,

Nicolas

Kunal Bhalla

unread,
Jul 24, 2011, 4:28:55 PM7/24/11
to event...@googlegroups.com
Well, the next major version of ep won't be before september end, and
that will have a better way of handling themes. All the code that
interferes with WordPress's normal theme loading is on line 417
onwards in wp.php ... you can modify using the filters provided to
insert your plugin's themes into the possible queue.

Kunal

Nicolas Duvieusart Déry

unread,
Jul 25, 2011, 11:44:44 AM7/25/11
to event...@googlegroups.com
Hi Kunal,

first, thank you for your quick response.

Here is the code I am using to filter to $current theme files.

"
function tk_ep_add_tk_themes($current)
{

   global $post;

   if ( 'ep_event' == $post->post_type )
      if ( !preg_match( '/events.php$/', $current ) )
         $current = TK_THEMES_PATH . '/tk-events.php';

   // $current = TK_THEMES_PATH . '/tk-events.php';

   return $current;

} // end tk_ep_add_tk_themes()
add_filter('ep_events_template', 'tk_ep_add_tk_themes', 10, 1);
"

However, it doesn't seem to be working. It still takes the files from EP theme folder. Am I doing this right ? 

Thanks,

Nicolas
Reply all
Reply to author
Forward
0 new messages