• Resolved planetthoughtful

    (@planetthoughtful)


    Hi All,

    I’d like to create some PHP pages to go with my WP site that require functionality not provided by WP.

    I’d like these pages to have the same look and feel as my WP pages (ie use the same theme and layout etc) and I’m wondering if there are WP functions you can include from somewhere that allow you to do the same things as include your theme’s sidebar, CSS and so on in a page that isn’t part of the WP package?

    Any help immensely appreciated!

    Much warmth,

    planetthoughtful

Viewing 4 replies - 1 through 4 (of 4 total)
  • MichaelH

    (@michaelh)

    Beel

    (@beel)

    <?php
    define(‘WP_USE_THEMES’, true);
    require(‘./path-to-your-blog/wp-blog-header.php’);
    ?>

    https://www.google.com/search?hl=en&lr=&q=site:www.ads-software.com+include+wp+in+other+pages&btnG=Search

    Thread Starter planetthoughtful

    (@planetthoughtful)

    @michaelh

    Thanks, I should have said that I was already aware of these plugins. As with many professional PHP developers, I have an aversion to using eval() to execute code; probably more of an aversion than I really need to have, but still.

    @beel

    Thanks for the tip, and for the Google link. I’ll take a look at them and see how I go.

    For what it’s worth, I’ve actually made some headway since I posted this topic with using custom WP page templates. I may have missed the point while reading the Codex, but it wasn’t obvious to me that you can use WP pages based on custom templates that will be interpreted dynamically from the template when called, rather than statically from the WP page.

    So, my current solution, which seems to be working, is to create a ‘template’ called feedbackform.php in my theme directory, with all of the funcationality built in that I need as well as having the site’s theme / css available, then create a page in WP based on that template, and use the page_id / slug to execute the code in the custom template.

    While this process is described on the Codex in Creative a Search Page, it didn’t stand out as being the answer I was looking for when I first read through it. A second read, and some experimentation, has proven otherwise.

    I’ll still go through the links you provided, Beel, since it seems these might offer me even more development freedom than the solution above.

    Thanks to both!

    Much warmth,

    planetthoughtful

    dubsix

    (@dubsix)

    I recently came across this plugin

    https://redalt.com/wiki/EzStatic

    which might also be what you’re after.

    cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Non-wp PHP pages using wp theme etc’ is closed to new replies.