Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating custom pages

  • Avatar of Florian
    Florian
    Participant

    @gquann

    Hi everybody,

    I’m trying to write a plugin which enables users to upload some data. So intend to create a page where the users can enter the data. Unfortunately, I’m a bit at a loss how to create such a page. Not the functionality within the page, but just the page. All mechanisms that I have found in the documentation seem to be about modifiying existing pages/posts, but I have found nothing about just creating a page under a custom URL (like /mydata/addnew or something like that).

    Does anyone have some hints how I could accomplish that?

    Greetings,
    Florian

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Check out the BP Skeleton Component:
    http://wordpress.org/extend/plugins/buddypress-skeleton-component/

    It teaches you how to create a whole plugin for BuddyPress; you won’t need to use all the code in the skeleton component, but it’ll help you structure your code for BP.

    The functions you want to look at in particular are:
    `bp_example_setup_globals()
    bp_example_setup_nav()`

    Both are located in bp-example-core.php.

    Hope that helps.

    Or take a look at an existing WordPress plugin that adds a page in the same area that does you want, and try to reverse engineer it. My Achievements (http://wordpress.org/extend/plugins/achievements) plugin is quite well documented ;)

    Avatar of Florian
    Florian
    Participant

    @gquann

    Thanks a lot for the pointers!

    The important trick seems to be to grab the ‘wp’ hook, check if the current request is for the custom page and then load the content. I’m still struggling with the BuddyPress-Template-Framework (bp_core_load_template just won’t cooperate), but I think I’ll just stick with directly loading my templates via load_template() for now. Since I’m not going to distribute the code, this hopefully won’t be too much of a problem.

    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.