Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating custom pages

  • @gquann

    Participant

    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)
  • @r-a-y

    Keymaster

    Check out the BP Skeleton Component:
    https://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.

    @djpaul

    Keymaster

    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 (https://wordpress.org/extend/plugins/achievements) plugin is quite well documented ;)

    @gquann

    Participant

    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)
  • The topic ‘Creating custom pages’ is closed to new replies.
Skip to toolbar