• Resolved izuro

    (@izuro)


    Hi,

    How can I include a static page when a user installs my custom theme?

    For e.g – when a WP blog WITHOUT a page called ‘My Pictures’ installs(activates) my custome theme, a static page ‘My Pictures’ is created

    Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hmm, good question.

    By default wordpress installation creates a single page called About. But this is not controlled by theme, it is created by WordPress Engine so you might want to take a look in code outside of theme folder.

    I’m hardly equipped or experienced enough to clear this up for you, but, this might be the answer you are looking for.

    https://www.youtube.com/watch?v=Hx5o_O1cK6s
    I like the McBuzz series, clear and concise.
    The site is https://www.mcbuzz.com with some 30 plus videos nicely arranged.

    Also try a search-specific terms “how to ….”

    He wasn’t asking this. The tutorial just shows how to make a static page from reading options.

    Ooooooof.

    Touching core WP files (and telling users to touch core WP files) is walking a bit on shaky ground, in my opinion, as many WP users have enough trouble with themes on their own without any fiddling with core files.

    A potential alternative would be to create a custom page template for the pictures page and give users the option of using the pictures page template as their page template when they themselves create a pictures page.

    But yeah, if you’re looking to auto load a WP page named Pictures (like the About page that fldtrace is talking about) upon theme load, then that will require some way of tweaking WP’s core files.

    … Perhaps a plugin option or maybe a theme function/option?

    Thread Starter izuro

    (@izuro)

    Touching the core files is the last thing I would want to do..
    It seems as I dug deeper, plugin/theme functions are the way to go, although I’ve yet to figure out how to create static pages from there.

    I like EMG’s first suggestion and I guess that should suffice, as long as I provide instructions to use that template and create the pictures page after theme activation.
    But still, it’d be good to have it done automatically :/

    Anyway thank you all for the suggestions!

    Essentially you’re wanting your theme to create a new entry in the database, i don’t think this is really the scope of a theme’s possibilities, nor do i think this is the kind of behaviour a theme should be able to exhibit..

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Include static page when creating theme’ is closed to new replies.