Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created a custom component using the latest skeleton framework that needs to have its URLs as part of the current group. I have accomplished this is in my component's setup_nav() function, but when I try to access the URL I get a 404 error. I have been trying to solve this issue all morning with no luck. Could someone kindly point me in the right direction?

Here is my component's setup_nav method:

function setup_nav()
{
        $link = trailingslashit(bp_get_root_domain().'/'.bp_get_groups_root_slug().'/'.bp_get_current_group_slug().'/'.bp_get_announcements_slug());
        $slug = bp_get_announcements_slug();

        $main_nav = array('name'                => __('Announcements', 'bp-announcements'),
                          'slug'                => bp_get_current_group_slug(),
                          'position'            => -1,
                          'screen_function'     => 'bp_announcements_screen_list',
                          'default_subnav_slug' => 'all');
        $sub_nav[] = array('name'            =>  __('All Announcements', 'bp-announcements'),
                           'slug'            => 'all',
                           'parent_url'      => $link,
                           'parent_slug'     => bp_get_current_group_slug(),
                           'screen_function' => 'bp_announcements_screen_list',
                           'position'        => 10);
}
share|improve this question

closed as off-topic by kaiser Aug 7 at 11:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

I think I've figured out the issue. Even though my screens.php file is listed in my includes method, for some reason the function "bp_announcements_screen_list" does not work (perhaps it isn't being loaded?) If I change the value to a method in the component class ('screen_function' => aray(&$this,' bp_announcements_screen_list')), I can echo a string and have it show up on the 404 page (at least I get one - before I got nothing). Now I just need to figure out where to go from here.

Edit: I figured out what was wrong with my screens.php – I had to copy my template files over to my current theme.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.